1git-rebase(1)
2=============
34
NAME
5----
6git-rebase - Rebase local commits to new upstream head
78
SYNOPSIS
9--------
10'git-rebase' [--onto <newbase>] <upstream> [<branch>]
1112
DESCRIPTION
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).
1718
When 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.
2122
Assume the following history exists and the current branch is "topic":
2324
A---B---C topic
25/
26D---E---F---G master
2728
From this point, the result of either of the following commands:
2930
git-rebase master
31git-rebase master topic
3233
would be:
3435
A'--B'--C' topic
36/
37D---E---F---G master
3839
While, starting from the same point, the result of either of the following
40commands:
4142
git-rebase --onto master~1 master
43git-rebase --onto master~1 master topic
4445
would be:
4647
A'--B'--C' topic
48/
49D---E---F---G master
5051
In 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
5556
git am --resolved --3way
5758
Alternatively, you can undo the git-rebase with
5960
git reset --hard ORIG_HEAD
61rm -r .dotest
6263
OPTIONS
64-------
65<newbase>::
66Starting point at which to create the new commits. If the
67--onto option is not specified, the starting point is
68<upstream>.
6970
<upstream>::
71Upstream branch to compare against.
7273
<branch>::
74Working branch; defaults to HEAD.
7576
Author
77------
78Written by Junio C Hamano <junkio@cox.net>
7980
Documentation
81--------------
82Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
8384
GIT
85---
86Part of the gitlink:git[7] suite
87