git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-rewrite-history behaves quite contrary to documentation

From
David Kastrup <dak@gnu.org>
Date
Aug 9, 2007, 11:30 UTC
Message-ID
<86abt1j67h.fsf@lola.quinscape.zz>

git-filter-branch --index-filter 'git-update-index --force-remove --remove -g bilder bilder3' master trunk Rewrite a7a8f2fc263256c98ed5220e7467d34584c8c6ac (58/58) Ref 'refs/heads/master' was rewritten Ref 'refs/remotes/trunk' was rewritten

These refs were rewritten: fatal: Not a git repository: '/rep/akspiele/.git-rewrite/t/../../.git'

The manual page, however, claims:
	   git-filter-branch [--env-filter <command>] [--tree-filter <command>]
			 [--index-filter <command>] [--parent-filter <command>]
			 [--msg-filter <command>] [--commit-filter <command>]
			 [--tag-name-filter <command>] [--subdirectory-filter <directory>]
			 [-d <directory>] <new-branch-name> [<rev-list options>...]

<new-branch-name> apparently is completely ignored: specifying a non-existing branch will not work.

In the examples, it claims:
	   git filter-branch --index-filter 'git update-index --remove filename' newbranch
	Now, you will get the rewritten history saved in the branch
	newbranch (your current branch is left untouched).

This is again wrong: one needs to write "-g" at very least, or it will not bother removing a file that is not present in the working dir.

Could someone please pass this on to Dscho?  He has me in his killfile.
-- 
David Kastrup
Message 1 of 1 in “git-rewrite-history behaves quite contrary to documentation”
  1. David KastrupAug 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.