Created
February 21, 2012 16:26
-
-
Save proger/1877247 to your computer and use it in GitHub Desktop.
oneway git->svn sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SVN_HOST="https://svn/path/to/repo" | |
git checkout master | |
git pull --rebase | |
git config --local svn-remote.svn.url "${SVN_HOST}" | |
git config --local svn-remote.svn.fetch ":refs/remotes/git-svn" | |
git config --local svn.rmdir true | |
git svn fetch | |
git reset --hard HEAD | |
git branch -D temp-svn | |
git checkout -b temp-svn remotes/git-svn | |
git merge --log --stat -X theirs master | |
git checkout master -- . # resolve unmerged paths | |
[ -f .git/MERGE_MSG ] && git commit -F .git/MERGE_MSG | |
git svn dcommit && git checkout master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment