Skip to content

Instantly share code, notes, and snippets.

@garrensmith
Created April 7, 2010 11:58
Show Gist options
  • Select an option

  • Save garrensmith/358791 to your computer and use it in GitHub Desktop.

Select an option

Save garrensmith/358791 to your computer and use it in GitHub Desktop.
git svn clone -r[FROM REVISION NUMBER] svn:// #create git repository from svn repository
git svn rebase # get latest changes
git status # latest status of repository
git help COMMAND # get help on any command
git checkout -b BRANCH_NAME # create new branch
git branch #list branches
git checkout BRANCH_NAME #switch to branch
git merge BRANCH_NAME # merge changes from BRANCH_NAME into current branch
git add . # add all changes to staging area
git commit -m "MESSAGE" # commit changes in staging area
git svn dcommit # commit back to svn
----------------------------
BEST PRACTICES WORK FLOW
----------------------------
- update master branch to latest
- create new branch for new feature
- code..code..code..code..
- commit to local branch anytime you want to until feature is complete
- swich to master and get latest changes
- switch back to feature branch and merge changes from master and resolve and conflicts. This will keep the master clean from conflicts
- switch back to master and merge trunk
- commit
- push changes to svn
Links:
http://www.lostechies.com/blogs/jason_meridth/archive/2009/06/04/git-for-windows-developers-git-series-part-1.aspx
http://andy.delcambre.com/2008/03/04/git-svn-workflow.html
http://ariejan.net/2009/06/08/best-practice-the-git-development-cycle/
http://www.lostechies.com/blogs/scottcreynolds/archive/2009/05/05/getting-up-and-running-on-git-svn-5-minute-quickstart.aspx
Cheat Sheets:
http://github.com/guides/git-cheat-sheet
http://cheat.errtheblog.com/s/git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment