mirror of
https://github.com/git/git.git
synced 2024-11-18 15:04:49 +01:00
69a60af5d0
I found a paper thin man page for git-rebase, but was quite happy to see something much more useful in the usage statement of the script when I went there to find out how this thing worked. Here it is cleaned up slightly and expanded a bit into the actual documentation. Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
75 lines
1.6 KiB
Text
75 lines
1.6 KiB
Text
git-rebase(1)
|
|
=============
|
|
|
|
NAME
|
|
----
|
|
git-rebase - Rebase local commits to new upstream head.
|
|
|
|
SYNOPSIS
|
|
--------
|
|
'git-rebase' [--onto <newbase>] <upstream> [<branch>]
|
|
|
|
DESCRIPTION
|
|
-----------
|
|
git-rebase applies to <upstream> (or optionally to <newbase>) commits
|
|
from <branch> that do not appear in <upstream>. When <branch> is not
|
|
specified it defaults to the current branch (HEAD).
|
|
|
|
When git-rebase is complete, <branch> 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 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 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
|
|
|
|
OPTIONS
|
|
-------
|
|
<newbase>::
|
|
Starting point at which to create the new commits. If the
|
|
--onto option is not specified, the starting point is
|
|
<upstream>.
|
|
|
|
<upstream>::
|
|
Upstream branch to compare against.
|
|
|
|
<head>::
|
|
Working branch; defaults to HEAD.
|
|
|
|
Author
|
|
------
|
|
Written by Junio C Hamano <junkio@cox.net>
|
|
|
|
Documentation
|
|
--------------
|
|
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
|
|
|
|
GIT
|
|
---
|
|
Part of the gitlink:git[7] suite
|
|
|