Skogsv
Skogsv

Reputation: 490

Using Git filter-branch to rename author and committer of several branches including tags

I need to update all my previous commits to reflect a change in my user-name.

This needs to be done to all branches and also carry through all my tags. I'm the only committer and this is all done in my local repo only.

Using numerous sources on here I arrived at the command

git filter-branch --env-filter "GIT_AUTHOR_NAME='new_name'; GIT_COMMITTER_NAME='new_name';" --tag-name-filter cat -f -- --all

which seemed to do the trick, but

git log --all --graph

shows that instead of overwriting I now have a bunch more branches...

Am I missing something from my above snippet or do I also need to run some form of clean-up command as well?

Upvotes: 0

Views: 251

Answers (1)

Vampire
Vampire

Reputation: 38639

If you mean the backup copies in refs/original, you can easily delete those with the command you find on the help page of git-filter-branch: git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d

Upvotes: 1

Related Questions