Skip to content

Instantly share code, notes, and snippets.

@nz
Created October 30, 2008 05:55
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 nz/20927 to your computer and use it in GitHub Desktop.
Save nz/20927 to your computer and use it in GitHub Desktop.
# 0. Do all your work in a local branch, preferably named loosely for the feature you're working on.
git checkout -b work
# 1. Make sure all your changes are committed.
git commit -m "changes to a local branch"
# 2. Update the master branch, pulling down the latest code from the rest of the team
git checkout master
git pull
# 3. Rebase your local branch against the latest in master
git checkout work
git rebase master
# 4. Optional: fix conflicts and continue the rebase
git add conflicted/file1.rb conflicted/file2.rb
git rebase --continue
# 5. Switch back to master and merge your changes
git checkout master
git merge work
# 6. Push it all to the remote repository
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment