Skip to content

Instantly share code, notes, and snippets.

@KeeperPat
Created April 17, 2012 22:07
Show Gist options
  • Save KeeperPat/2409385 to your computer and use it in GitHub Desktop.
Save KeeperPat/2409385 to your computer and use it in GitHub Desktop.
Feature Branches

1. Switch to master and pull any new changes

(my-awesome-feature) ~/src/deals> git checkout master
Switched to branch 'master'
(master) ~/src/deals> git pull --rebase
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 6), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From svn.livingsocial.com:dev/deals
   f836434..d77c8fe  master     -> dev/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to d77c8fe5f751362e98fe169b2a66f846f777eaf1.

2. Switch back to your branch and rebase on master

(master) ~/src/deals> git checkout my-awesome-feature 
Switched to branch 'my-awesome-feature'
(my-awesome-feature) ~/src/deals> git rebase master
First, rewinding head to replay your work on top of it...
Applying: The _translated accessors (ie Deal#fine_print_translated) should fall back to the default (ie Deal#fine_print) if they are nil

3. Switch back to master and merge

(my-awesome-feature) ~/src/deals> git checkout master
Switched to branch 'master'
(master) ~/src/deals> git merge ff-only my-awesome-feature 
Updating d588325..1e287d5
Fast-forward
 README.md |   66 -------------------------------------------------------------
 1 files changed, 0 insertions(+), 66 deletions(-)
 delete mode 100644 README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment