git svn clone, with ` — authors-file`
What I learned today — 6 February 2018
Using git svn clone
to migrate a SVN repository to Git, or even just as a better interface to SVN, seems like an obvious way to improve your life. In practice it’s not always as simple as the packaging suggests.
At least in our case it wasn’t. The solution turned out to be to provide an authors-file. The successful command looked like this:
git svn clone https://svn.example.com/svn/OurReallyOldProject/trunk --authors-file authors.txt target-directory
The authors file contains mappings of usernames to email addresses, because Git requires more information about committers than SVN does. The file was generated using a migration tool from Atlassian, which creates email addresses like, “user@mycompany.com”, which is good enough for maintaining history that didn’t contain that level of detail in the first place.
The final discovery was that making a shallow clone (using the -r
option) worked fine, but “unshallowing” by fetching didn’t.