Re:Please use git pull --rebase
by Zombieball on Tuesday April 30, 2013 @09:28PM
(#5635945)
Ah awesome, I love there are so many things to learn about git.
I knew about git rebase -p and its nuances, but haven't known about the --onto until now. The 3-argument form of git rebase --onto in your blog post was great, thanks!
In this case, you have a merge commit from a branch on to master, which would look like:
Once you find out your master (B) is behind, because say there's G-H-I on origin, you'd want to rebase onto that. So you use the 3-argument form of git rebase --onto:git rebase --onto origin/master C~1 E
Which would take C's old base, C~1 (B), and replace it with origin/master, but only up to E.
Or, if you still had the branch around that you merged into master (which you do, in many forms, including the reflog, even after you delete the branch).
git rebase --onto origin/master topicA
I wrote a blog post on the different uses of git rebase --onto: http://krishicks.com/blog/2012/05/28/git-rebase-onto/