This assumes a one way sync from svn to git.
In order to convert svn commits to git commit there needs to be a clear mapping between svn and git users. This is accomplished with a simple mapping file. It is possible to map multiple svn users to the same git user.
authors.txt:
Stefan Foulis = stefanfoulis <stefan.foulis@gmail.com> stefanfoulis = stefanfoulis <stefan.foulis@gmail.com> jonasobrist = ojii <jonas.obrist@divio.ch>
If you don't want to create this file by hand, you can use the find_authors.sh
script below.
make a full checkout using git-svn. The -s switch tells git-svn
to assume the default trunk, branches, tags layout.:
git svn --authors-file=authors.txt clone -s svn+ssh://myusername@mysvnserver/svn/myproject myproject-gitsvn cd myproject-gitsvn
push to git:
git remote add origin git@github.com:stefanfoulis/django-filer.git git push origin --all git push origin --tags
update from svn:
git svn rebase git push origin --all git push origin --tags
Warning
getting changes from git back to svn is hard. try to avoid that. merging changes from svn to git if there are changes in the git branch is annoying. try to avoid that. Make a separate branch for development in git.