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

git filter-branch examples on man page are outdated

From
JCJeffrey Chupp <jeff@semanticart.com>
Date
Feb 12, 2009, 16:33 UTC
Message-ID
<AB13D1C5-4464-49B5-8314-FCB1E249BF22@semanticart.com>

http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html mb:repo jeff$ ls db/data/us_cities.data.insert.sql db/data/us_cities.data.insert.sql mb:repo jeff$ git filter-branch --index-filter 'git rm -f --cached db/ data/us_cities.data.insert.sql' HEAD Rewrite d54d3041d7d5739b3093f802fc1ef45f3c8e5e16 (1/2713)fatal: pathspec 'db/data/us_cities.data.insert.sql' did not match any files index filter failed: git rm -f --cached db/data/ us_cities.data.insert.sql

ekidd speculated that since the file wasn't in the first version of the repo, it was borking. He was right. Next he told me to try

git filter-branch --index-filter 'git rm -f --cached db/data/ us_cities.data.insert.sql || true'

which worked.  He also asked me to point this out on this list:

ekidd:semanticart: Commit 8c1ce0f46b85d40f215084eed7313896300082df changed the behavior without updating the example in the man page. If you're feeling inspired, you may want to post this to git@vger.

Thanks and apologies for any etiquette breaches, I don't know what I'm doing :)

-jeff
Next: Jacob Helwig
Message 1 of 4 in “git filter-branch examples on man page are outdated”
  1. Jeffrey ChuppFeb 12, 2009
  2. Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filterJacob Helwig, Feb 12, 2009
  3. Junio C HamanoFeb 12, 2009
  4. Johannes SchindelinFeb 12, 2009

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.