The man page of git filter branch
says:
use "--tag-name-filter cat" to simply update the tags.
Later it even says:
use --tag-name-filter cat -- --all
However --all
should include --tags
, hence all tags should properly get rewritten.
A small test verifies this:
$ git init
$ mkdir dir
$ touch dir/file
$ git add .
$ git commit -am init
$ git ls-files
dir/file
$ git tag tag
$ git for-each-ref
3006eb0a031e40901122ac8984c85ad533982f8b commit refs/heads/master
3006eb0a031e40901122ac8984c85ad533982f8b commit refs/tags/tag
$ git filter-branch --subdirectory-filter dir -- --all
Rewrite 3006eb0a031e40901122ac8984c85ad533982f8b (1/1)
Ref 'refs/heads/master' was rewritten
Ref 'refs/tags/tag' was rewritten
$ git for-each-ref
8e5f09c93a2fbdb435dbe7019abeb841cb5857b2 commit refs/heads/master
3006eb0a031e40901122ac8984c85ad533982f8b commit refs/original/refs/heads/master
3006eb0a031e40901122ac8984c85ad533982f8b commit refs/original/refs/tags/tag
8e5f09c93a2fbdb435dbe7019abeb841cb5857b2 commit refs/tags/tag
Therefore the question:
In which situation do I need --tag-name-filter cat
?
There is also Why has git-filter-branch not rewritten tags?, but I don't see, how to get into such a situation.