-
-
Save radmen/2300725 to your computer and use it in GitHub Desktop.
git svn workflow
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
# adapted from http://notes.jimlindley.com/2008/3/25/git-svn-that-works-for-me | |
# initial setup | |
git svn init <svn_repo> | |
git svn fetch -r HEAD | |
# alternate way - when there's need to use branches etc | |
git svn clone --trunk=devel --branches=branches -r NUM <svn_repo> # NUM is one of the latest revisions | |
git svn fetch | |
# alternate way - END | |
git svn show-ignore | sed '/^$/d' | sed '/^#/d' > .gitignore # watchout it's extremely slow | |
git add .gitignore | |
git commit -m "Added gitignore" | |
git svn dcommit # push changes to repo | |
# begin the workflow | |
git svn fetch -r HEAD # aliased to 'git up' | |
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 commit | |
git svn dcommit | |
git repack -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment