A git workflow to use SVN server with Git from Windows through an intermediate Git in Linux
[tom@my-linux-machine:~] $ git config --global receive.denycurrentbranch ignore
C:\>git config --global merge.commit no
[tom@my-linux-machine:~/home/src] $ git svn clone -s -r28718:HEAD http://subversion.ny.mycompany.com/svn/repos/ABC/my-project
C:\dev> git clone tom@my-linux-machine:home/src/my-project
C:\dev\my-project> git add --patch MyClass.java
C:\dev\my-project> git commit -m "Fixed Bug"
C:\dev\my-project> git push
[tom@my-linux-machine:~/home/src] $ git reset --hard
[tom@my-linux-machine:~/home/src] $ git svn dcommit
This takes all the commits you’ve made on top of the Subversion server code, does a Subversion commit for each, and then rewrites your local Git commit to include a unique identifier. This is important because it means that all the SHA-1 checksums for your commits change.
Because the SHA-1 changes after dcommit
, pull back the same commit with the differnt SHA-1
C:\dev\my-project> git fetch
C:\dev\my-project> git reset origin/master
[tom@my-linux-machine:~/home/src/my-project] $ git svn rebase
C:\dev\my-project> git pull --ff-only
If failed, rebase and resolve the conflicts
C:\dev\my-project> git stash
C:\dev\my-project> git pull --rebase
C:\dev\my-project> git stash pop