Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mass-renaming Git authors?

Tags:

git

I'm using svn2git to create a Git repository from an existing SVN repository. I got it all downloaded (all 10+ branches, 10+ tags, >4000 commits) and in a Git repo. Now, unfortunately, all the authors are messed up.

All of the authors don't have email addresses or names, and most authors have used multiple email addresses over the life of the project, so I might like to merge them down. How can I do this?

like image 707
Naftuli Kay Avatar asked Jan 18 '23 19:01

Naftuli Kay


1 Answers

The tool you want is git-filter-branch. This allows you to set up a "commit filter" that changes the author names for each commit in your repository.

This is a step that you would set up and run once after running svn2git. It's not something you would normally want to run on a Git repository that you've made any further commits to.

Your question indicates that "All of the authors don't have email addresses or names", which seems to indicate that something in svn2git didn't quite do what it was supposed to. However, note that Git has two names for each commit - the "author" and the "committer" (because they can be different).

like image 97
Greg Hewgill Avatar answered Jan 24 '23 22:01

Greg Hewgill