git-tips / tips

Most commonly used git tips and tricks.
http://git.io/git-tips
MIT License
21.39k stars 1.7k forks source link

Add change a branch base tips #160

Closed lmarvaud closed 6 years ago

lmarvaud commented 6 years ago

Based on : https://stackoverflow.com/questions/10853935/change-branch-base

Tested on git version 2.11.0 (Apple Git-81) :

$ git --version
git version 2.11.0 (Apple Git-81)
$ git log --oneline | cat
f494716 Commit to merge
297dd99 Commit not to merge
d3bd657 Initial commit
$ git rebase --onto master dev
First, rewinding head to replay your work on top of it...
Applying: Commit to merge
$ git log --oneline | cat
ef49494 Commit to merge
4c3a806 Commit on master
d3bd657 Initial commit