aboutsummaryrefslogtreecommitdiff
path: root/Documentation/git-reset.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-12-29 01:21:45 -0800
committerJunio C Hamano <gitster@pobox.com>2008-12-29 01:21:45 -0800
commitc32f76f4d220e5d4d6a599d7a12a50b1e3ceceaf (patch)
treeffa6c4e6fd861ac3c77cbc5ff3f621f3e5f9c3f9 /Documentation/git-reset.txt
parent78d4096d573ae796f72e5b05bf1c332f038e54dd (diff)
parent1b5b465fbde9515e04bd1e8524a208c92af3555e (diff)
downloadgit-c32f76f4d220e5d4d6a599d7a12a50b1e3ceceaf.tar.gz
git-c32f76f4d220e5d4d6a599d7a12a50b1e3ceceaf.tar.xz
Merge branch 'lt/reset-merge'
* lt/reset-merge: Document "git-reset --merge" Add 'merge' mode to 'git reset'
Diffstat (limited to 'Documentation/git-reset.txt')
-rw-r--r--Documentation/git-reset.txt29
1 files changed, 28 insertions, 1 deletions
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 2049f3d97..abb25d1c0 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -8,7 +8,7 @@ git-reset - Reset current HEAD to the specified state
SYNOPSIS
--------
[verse]
-'git reset' [--mixed | --soft | --hard] [-q] [<commit>]
+'git reset' [--mixed | --soft | --hard | --merge] [-q] [<commit>]
'git reset' [-q] [<commit>] [--] <paths>...
DESCRIPTION
@@ -45,6 +45,11 @@ OPTIONS
switched to. Any changes to tracked files in the working tree
since <commit> are lost.
+--merge::
+ Resets the index to match the tree recorded by the named commit,
+ and updates the files that are different between the named commit
+ and the current commit in the working tree.
+
-q::
Be quiet, only report errors.
@@ -152,6 +157,28 @@ tip of the current branch in ORIG_HEAD, so resetting hard to it
brings your index file and the working tree back to that state,
and resets the tip of the branch to that commit.
+Undo a merge or pull inside a dirty work tree::
++
+------------
+$ git pull <1>
+Auto-merging nitfol
+Merge made by recursive.
+ nitfol | 20 +++++----
+ ...
+$ git reset --merge ORIG_HEAD <2>
+------------
++
+<1> Even if you may have local modifications in your
+working tree, you can safely say "git pull" when you know
+that the change in the other branch does not overlap with
+them.
+<2> After inspecting the result of the merge, you may find
+that the change in the other branch is unsatisfactory. Running
+"git reset --hard ORIG_HEAD" will let you go back to where you
+were, but it will discard your local changes, which you do not
+want. "git reset --merge" keeps your local changes.
+
+
Interrupted workflow::
+
Suppose you are interrupted by an urgent fix request while you