From e8dd7e0b579542ac294229e61f1780a8aa375343 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sun, 23 Apr 2017 11:11:31 +0100 Subject: [PATCH] rephrase --onto example; add in-place rebase --- pages/common/git-rebase.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/common/git-rebase.md b/pages/common/git-rebase.md index dafd73fc5..0b0e8d4a9 100644 --- a/pages/common/git-rebase.md +++ b/pages/common/git-rebase.md @@ -1,7 +1,7 @@ # git rebase -> Apply local commits on top of another branch's history. -> This effectively "moves" an entire branch to another base, by creating copies of the commits in the new location. +> Reapply commits from one branch on top of another branch. +> 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: @@ -19,6 +19,10 @@ `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`