GIT-REBASE(1) Git Manual GIT-REBASE(1) (NAME) git-rebase - (SYNOPSIS) git rebase [-i | --interactive] [] [--exec ] [--onto | --keep-base] [ []] git rebase [-i | --interactive] [] [--exec ] [--onto ] --root [] git rebase (--continue|--skip|--abort|--quit|--edit-todo|--show-current-patch) (DESCRIPTION) . git rebase : INTERACTIVE MODE . topic master . A---B---C topic / D---E---F---G master topic master ( A B C) master . git rebase master topic (checkout) . topic git rebase master topic git checkout topic && git rebase master . A'--B'--C' topic / D---E---F---G master git rebase . : 1. . git diff (<<<<<<) . . git add . git rebase --continue 2. git rebase git rebase --abort 3. git rebase --skip branch..remote branch..merge ( git- config(1) ) --fork-point . . git rebase : 1. . 2. (checkout) git checkout --detach . 3. . git cherry-pick . REBASING MERGES . 4. git checkout -B . ORIG_HEAD . ORIG_HEAD ORIG_HEAD ( git reset) . reflog ( @{1} gitrevisions(7) ) . --ONTO (TRANSPLANTING A TOPIC BRANCH WITH --ONTO) rebase --onto . topic next . topic next . o---o---o---o---o master \ o---o---o---o---o next \ o---o---o topic topic master topic master . : o---o---o---o---o master | \ | o'--o'--o' topic \ o---o---o---o---o next : git rebase --onto master next topic --onto . : H---I---J topicB / E---F---G topicA / A---B---C---D master git rebase --onto master topicA topicB : H'--I'--J' topicB / | E---F---G topicA |/ A---B---C---D master topicB topicA . . : E---F---G---H---I---J topicA git rebase --onto topicA~5 topicA~3 topicA F G : E---H'---I'---J' topicA F G topicA . --onto (commit-ish) . (MODE OPTIONS) : --continue . --skip . --abort HEAD . HEAD . HEAD . --quit HEAD . . (stash) --autostash . --edit-todo (todo) . --show-current-patch . git show REBASE_HEAD . (OPTIONS) --onto . --onto . . (merge base) "A...B" A B . A B HEAD . TRANSPLANTING A TOPIC BRANCH WITH --ONTO . --keep-base (merge base) . git rebase --keep-base git rebase --reapply-cherry-picks --no-fork-point --onto ... . . . --reapply-cherry-picks . --fork-point --fork-point . INCOMPATIBLE OPTIONS . . . . HEAD . --apply (apply) ( git-am). merge apply (no-op) . INCOMPATIBLE OPTIONS . --empty=(drop|keep|stop) (clean cherry-picks) ( ): drop . . keep . --exec -i/--interactive . stop, ask . -i/--interactive . ask stop . ( --no-keep-empty ) ( git log --cherry-mark ... ) ( --reapply-cherry-picks --keep-base ). INCOMPATIBLE OPTIONS . --no-keep-empty, --keep-empty ( ) . --allow-empty git commit . . . --empty . INCOMPATIBLE OPTIONS . --reapply-cherry-picks, --no-reapply-cherry-picks (clean cherry-picks) . ( --empty .) --keep-base ( --no-reapply-cherry-picks ) . . merge ( --quiet ). advice.skippedCherryPicks false ( git-config(1) ). --reapply-cherry-picks rebase . INCOMPATIBLE OPTIONS . --allow-empty-message (No-op). . . INCOMPATIBLE OPTIONS . -m, --merge (). . ours theirs . . INCOMPATIBLE OPTIONS . -s , --strategy= ort. --merge . git rebase ours . INCOMPATIBLE OPTIONS . -X , --strategy-option= . --merge -s ort . ours theirs -m . INCOMPATIBLE OPTIONS . --rerere-autoupdate, --no-rerere-autoupdate rerere (index) . --no-rerere-autoupdate git-rerere(1) git-add(1) . -S[], --gpg-sign[=], --no-gpg-sign GPG. keyid . --no-gpg-sign commit.gpgSign --gpg-sign . -q, --quiet . --no-stat . -v, --verbose . --stat . --stat (diffstat) . diffstat rebase.stat . -n, --no-stat (diffstat) . --no-verify pre-rebase . githooks(5) . --verify pre-rebase . --no-verify . githooks(5) . -C (context) . . . --apply . INCOMPATIBLE OPTIONS . --no-ff, --force-rebase, -f (fast-forward) . . (topic branch) << >> (revert the reversion) ( revert-a-faulty-merge How-To[1] ). --fork-point, --no-fork-point reflog . --fork-point fork_point fork_point git merge-base --fork-point ( git-merge- base(1) ). fork_point . --keep-base --no-fork-point --fork-point . rebase.forkpoint git-config(1) . (rewound) --keep-base . INCOMPATIBLE OPTIONS . --ignore-whitespace (whitespace) . : apply . <<>> . merge . (patch hunk) . --whitespace=