rephrase --onto example; add in-place rebase

coverage
Waldir Pimenta 2017-04-23 11:11:31 +01:00
parent 8f18647c82
commit e8dd7e0b57
1 changed files with 8 additions and 4 deletions

View File

@ -1,7 +1,7 @@
# git rebase # git rebase
> Apply local commits on top of another branch's history. > Reapply commits from one branch on top of another branch.
> This effectively "moves" an entire branch to another base, by creating copies of the commits in the new location. > Commonly used to "move" an entire branch to another base, creating copies of the commits in the new location.
- Rebase the current branch on top of the master branch: - Rebase the current branch on top of the master branch:
@ -19,6 +19,10 @@
`git rebase --abort` `git rebase --abort`
- Rebase a branch starting from a specific base commit, rather than the common ancestor shared with the target branch: - Move part of the current branch onto a new base, providing the old base to start from:
`git rebase --onto {{new_base_commit}} {{old_base_commit}}` `git rebase --onto {{new_base}} {{old_base}}`
- Reapply the last 5 commits in-place, stopping to adjust them (reword, combine, reorder or remove):
`git rebase -i HEAD~5`