Skip to content

Instantly share code, notes, and snippets.

@smgoller
Forked from mhinze/gist:123732
Created August 25, 2011 16:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save smgoller/1171102 to your computer and use it in GitHub Desktop.
Save smgoller/1171102 to your computer and use it in GitHub Desktop.
git svn workflow
# adapted from http://notes.jimlindley.com/2008/3/25/git-svn-that-works-for-me
# initial setup
git svn clone <svn_repo>
# begin the workflow
git svn fetch -r HEAD --ignore-paths="Package.zip" # aliased to 'git up', my Package.zip is very large.
git svn rebase -l # we just updated, no need to go back to the svn repo
# 99% of daily workflow
git checkout -b <work_branch>
# ----- hack loop
git add .
git commit -a -m <message>
# ---- hack loop end
# ----- update master loop
git checkout master
git up
git svn rebase -l
# now that master is current with svn,
# sync working branch to local master
git checkout <work_branch>
git rebase master # conflicts here: git mergetool -t tortoisemerge
# ----- update master loop end
# final upstream commit after rebasing
git checkout master
git up
git svn rebase -l # one last check for new svn check ins
git merge --squash <work_branch>
git svn dcommit -e # -e allows us to enter an svn commit message
git repack -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment