summaryrefslogtreecommitdiff
path: root/Documentation/git-rebase.txt
blob: 4a7e67a4d2241a82a564734d64789e6ee13c8330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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 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
-------
<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.

<branch>::
	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