1git-rebase(1) 2============= 3 4NAME 5---- 6git-rebase - Rebase local commits to new upstream head 7 8SYNOPSIS 9-------- 10'git-rebase' [--onto <newbase>] <upstream> [<branch>] 11 12DESCRIPTION 13----------- 14git-rebase applies to <upstream> (or optionally to <newbase>) commits 15from <branch> that do not appear in <upstream>. When <branch> is not 16specified it defaults to the current branch (HEAD). 17 18When git-rebase is complete, <branch> will be updated to point to the 19newly created line of commit objects, so the previous line will not be 20accessible unless there are other references to it already. 21 22Assume the following history exists and the current branch is "topic": 23 24 A---B---C topic 25 / 26 D---E---F---G master 27 28From this point, the result of either of the following commands: 29 30 git-rebase master 31 git-rebase master topic 32 33would be: 34 35 A'--B'--C' topic 36 / 37 D---E---F---G master 38 39While, starting from the same point, the result of either of the following 40commands: 41 42 git-rebase --onto master~1 master 43 git-rebase --onto master~1 master topic 44 45would be: 46 47 A'--B'--C' topic 48 / 49 D---E---F---G master 50 51In case of conflict, git-rebase will stop at the first problematic commit 52and leave conflict markers in the tree. After resolving the conflict manually 53and updating the index with the desired resolution, you can continue the 54rebasing process with 55 56 git am --resolved --3way 57 58Alternatively, you can undo the git-rebase with 59 60 git reset --hard ORIG_HEAD 61 rm -r .dotest 62 63OPTIONS 64------- 65<newbase>:: 66 Starting point at which to create the new commits. If the 67 --onto option is not specified, the starting point is 68 <upstream>. 69 70<upstream>:: 71 Upstream branch to compare against. 72 73<branch>:: 74 Working branch; defaults to HEAD. 75 76Author 77------ 78Written by Junio C Hamano <junkio@cox.net> 79 80Documentation 81-------------- 82Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. 83 84GIT 85--- 86Part of the gitlink:git[7] suite 87