Skip to content

Commit

Permalink
Attempt to improve git-rebase lead-in description.
Browse files Browse the repository at this point in the history
It was mentioned on #git this morning that the lead-in description
of git-rebase is very confusing.  Too many branch this and branch
that in a very short run of text.

This new description attempts to walk the user through the command
syntax, while also describing exactly what git-rebase is doing to
their repository.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
spearce authored and Junio C Hamano committed Feb 17, 2007
1 parent 185c975 commit 5ca2db5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Documentation/git-rebase.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@ SYNOPSIS

DESCRIPTION
-----------
git-rebase replaces <branch> with a new branch of the same name. When
the --onto option is provided the new branch starts out with a HEAD equal
to <newbase>, otherwise it is equal to <upstream>. It then attempts to
create a new commit for each commit from the original <branch> that does
not exist in the <upstream> branch.
If <branch> is specified, git-rebase will perform an automatic
`git checkout <branch>` before doing anything else. Otherwise
it remains on the current branch.

All changes made by commits in the current branch but that are not
in <upstream> are saved to a temporary area. This is the same set
of commits that would be shown by `git log <upstream>..HEAD`.

The current branch is reset to <upstream>, or <newbase> if the
--onto option was supplied. This has the exact same effect as
`git reset --hard <upstream>` (or <newbase>).

The commits that were previously saved into the temporary area are
then reapplied to the current branch, one by one, in order.

It is possible that a merge failure will prevent this process from being
completely automatic. You will have to resolve any such merge failure
Expand All @@ -26,9 +35,6 @@ that caused the merge failure with `git rebase --skip`. To restore the
original <branch> and remove the .dotest working files, use the command
`git rebase --abort` instead.

Note that if <branch> is not specified on the command line, the currently
checked out branch is used.

Assume the following history exists and the current branch is "topic":

------------
Expand Down

0 comments on commit 5ca2db5

Please sign in to comment.