Skip to content

Instantly share code, notes, and snippets.

@unixcharles
Created June 12, 2010 01:01
Show Gist options
  • Save unixcharles/435266 to your computer and use it in GitHub Desktop.
Save unixcharles/435266 to your computer and use it in GitHub Desktop.
Here is the complete workflow
$ git clone git@github.com:unixcharles/refinerycms.git && cd refinerycms
Create a new branch
$ git checkout -b bugfixes
... some change, few days and a few commits later... I can also push the work-in-process-branch change to github if I plan to work on a different computer or share idea
When I'm done I do:
checkout back to my repo master
$ git checkout origin/master
Add refinery master repo
$ git remote add upstream git://github.com/resolve/refinerycms.git
And pull cleanly to the latest head
$ git pull upstream master
From there if I have only a few commit, option A Cherry-pick
Make sure your in still in your local master branch
$ git checkout master
Cherry-pick whatever you commited one by one using the head of the commits in your other branch
$ git cherry-pick 58ac6879d4096736ae67 Push to your repo
$ git push origin master
option B) Rebase and clean your commit tree commit tree
Checkout your branch
$ git checkout bugfixes
Rebase, you'll have the possibility to squash some of the commit together to make the tree clean.
$ git rebase -i master
Remove your old master master
$ git branch -d master
Change your branch name back to master or create a new master branch from your branch
$ git checkout -b master
Push
$ git push origin master
I'm not sure if this is the way of doing thing, but no body complain since tree are clean and easy to read. Make it easy to keep it one-task one-commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment