X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-rebase.sh;h=5956f0654e1b344db7893519e309a45aa22ae16f;hb=9acf322d69f54ff5bf9de8b2d6f9cd1dccf523a3;hp=21c3d83c3ade9bfb0cdabb00928eab4606062c1a;hpb=0f4aa3993de5fc7252e43ebd872fd9e4b615873d;p=git.git diff --git a/git-rebase.sh b/git-rebase.sh index 21c3d83c..5956f065 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -4,24 +4,28 @@ # USAGE='[--onto ] []' -LONG_USAGE='If is specified, switch to that branch first. Then, -extract commits in the current branch that are not in , -and reconstruct the current on top of , discarding the original -development history. If --onto is specified, the history is -reconstructed on top of , instead of . For example, -while on "topic" branch: +LONG_USAGE='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. + +Assuming the following history: A---B---C topic / D---E---F---G master - $ '"$0"' --onto master~1 master topic +The result of the following command: -would rewrite the history to look like this: + git-rebase --onto master~1 master topic + would be: - A'\''--B'\''--C'\'' topic - / + A'\''--B'\''--C'\'' topic + / D---E---F---G master ' @@ -71,7 +75,7 @@ esac # The upstream head must be given. Make sure it is valid. upstream_name="$1" upstream=`git rev-parse --verify "${upstream_name}^0"` || - die "invalid upsteram $upstream_name" + die "invalid upstream $upstream_name" # If a hook exists, give it a chance to interrupt if test -x "$GIT_DIR/hooks/pre-rebase"