X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=Documentation%2Fgit-rebase.txt;h=4a7e67a4d2241a82a564734d64789e6ee13c8330;hb=46b8dec038be1125153e9fc816a1e1f0a9d2de77;hp=16c158f439c7299b92c4419d8a6233ef20fed914;hpb=0493a3fd5204a36bc961a8611770ddb9ec1ed8ed;p=git.git diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 16c158f4..4a7e67a4 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -3,22 +3,74 @@ git-rebase(1) NAME ---- -git-rebase - Rebase local commits to new upstream head. +git-rebase - Rebase local commits to new upstream head SYNOPSIS -------- -'git-rebase' [] +'git-rebase' [--onto ] [] DESCRIPTION ----------- -Rebases local commits to the new head of the upstream tree. +git-rebase applies to (or optionally to ) commits +from that do not appear in . When is not +specified it defaults to the current branch (HEAD). + +When git-rebase is complete, will be updated to point to the +newly created line of commit objects, so the previous line will not be +accessible unless there are other references to it already. + +Assume the following history exists and the current branch is "topic": + + A---B---C topic + / + D---E---F---G master + +From this point, the result of either of the following commands: + + git-rebase master + git-rebase master topic + +would be: + + A'--B'--C' topic + / + D---E---F---G master + +While, starting from the same point, the result of either of the following +commands: + + git-rebase --onto master~1 master + git-rebase --onto master~1 master topic + +would be: + + A'--B'--C' topic + / + D---E---F---G master + +In case of conflict, git-rebase will stop at the first problematic commit +and leave conflict markers in the tree. After resolving the conflict manually +and updating the index with the desired resolution, you can continue the +rebasing process with + + git am --resolved --3way + +Alternatively, you can undo the git-rebase with + + git reset --hard ORIG_HEAD + rm -r .dotest OPTIONS ------- +:: + Starting point at which to create the new commits. If the + --onto option is not specified, the starting point is + . + :: Upstream branch to compare against. -:: +:: Working branch; defaults to HEAD. Author