Skip to content

Instantly share code, notes, and snippets.

@jraines
Created April 26, 2011 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jraines/942756 to your computer and use it in GitHub Desktop.
Save jraines/942756 to your computer and use it in GitHub Desktop.
Git workflow

Before starting work on a feature, check out a topic branch

git checkout -b topic

If the branch is already in progress and already exists on the remote repo, check it out as a tracking branch

git checkout --track -b topic origin/topic

Push the branch to your remote repo so others can work on it

git push origin topic

Once done, squash the branch's commits down to one with an interactive rebase

git rebase master -i

Checkout master and pull

git checkout master git pull

Merge in the topic branch

git merge topic

Delete the branch locally and remotely

git branch -d topic

git push origin :topic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment