On Sun, Sep 9, 2012 at 12:53 PM, Patrick <pn1.d...@gmail.com> wrote:

> Local Repo
> 12 commits ahead of origin/master
> How do I take those 12 commits and pull them off on a branch?

I haven't tried this completely but since you haven't pushed the branch,I
think something like

1) git branch -m master new_branch_name
2) git fetch origin
3) git branch --track master origin/master
4) git checkout master
5) git branch -f new_branch_name master
6) git config branch.new_branch_namel.merge refs/heads/new_branch_name
7) git checkout new_branch_name
8) git push origin new_branch_name:refs/heads/new_branch_name

First we give the local master branch the new name (1).
Then we make sure we have the latest changes from master (2).
Then we create a new local master branch which tracks the remote master (3).
We then checkout the master branch(4) to allow us to set the starting point
of the new branch(5)
Next we tell the new branch to merge changes to the right branch on origin
(6) Note this remote branch won't exist yet.
Finally we checkout the new local branch(7) and push it to the remote repo.

Rick DeNatale

Google+: +Rick DeNatale <https://plus.google.com/102541178931067955550>
Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to