a part of our team found out that git is cool and started using it as a svn client. So every developer had a local git repository and synced it with svn via git-svn.
Then we wanted to do code reviews of the commits and send patches to collegues for review. This approach was not very intuitive, since the checksums of the SAME Revision in svn was different for each local git repository. No clue why, since the content should be the same. Maybe it is a bug in svn rebase
?
So we tried to have a central git repository on the scm server. Every developer that uses git now could push his changes to this central repository and the other developer doing the review could pull those into his repo. Unfortunatelly because every developer also synced with svn rebase
the checksum problem was there again.
After reading many posts I think the best way to manage a team with both subversion and git clients is to have:
Now we need a central job to sync svn with git doing a regular script like this on a central git working copy on the server.
# First transfer the commits from git to svn
git checkout svnmaster
git pull origin svnmaster
git svn dcommit
# Now from svn to git
git svn rebase
git push origin svnmaster
My questions now are:
Thanks for every answer!
EDIT I recently found a project that looks very promising:
SubGit
There is problem with your solution. I recommend you not to commit in svnmaster directly. You should have one pure git branch for svn(svn-dev), and svn tracking branch(svn-master). Follow these steps to commit to svn:
git checkout svn-master
git merge --no-ff svn-dev
git svn dcommit
git checkout svn-dev
git merge svn-master
This sequence allows you to preserve commit hashes for all repositories.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With