Skip to content

Instantly share code, notes, and snippets.

@auricgoldfinger
Created August 11, 2016 10:46
Show Gist options
  • Save auricgoldfinger/57e51451c953ee4ccfe693f99146f4da to your computer and use it in GitHub Desktop.
Save auricgoldfinger/57e51451c953ee4ccfe693f99146f4da to your computer and use it in GitHub Desktop.
My git svn workflow using merges
# checkout svn trunk revision 123456
git svn clone -r123456:HEAD https://svn.example.com/svn/trunk/project
# create branch on which you do your modifications
git checkout -b feature-branch
# do your modifications, then commit locally, eventually "git add" new files
git commit
# sync with svn
git checkout master
git svn rebase
git pull
git push origin master # origin is my personal one. Not upstream.
git checkout feature-branch
git merge master
git push origin feature-branch
# feature branch is now up to date with svn. Merge it into master
git checkout master
git merge feature-branch
# only when multiple svn rebases have taken place, squash the duplicate commits
git log --oneline --decorate
git rebase -i HEAD~2 # 2 is the number of commits without the merges
git svn dcommit
git pull
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment