summaryrefslogtreecommitdiff
path: root/Documentation/user-manual.txt
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2009-11-22 22:26:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-23 00:07:28 (GMT)
commite63ec003b2a0c89f0c1cbc4862dcef7c4a14a785 (patch)
tree8d4aa3ed37aab9242f2bf4192c86d2991d6f23f8 /Documentation/user-manual.txt
parent4c371f91270792791f867d15f25b03f800ab35a1 (diff)
downloadgit-e63ec003b2a0c89f0c1cbc4862dcef7c4a14a785.zip
git-e63ec003b2a0c89f0c1cbc4862dcef7c4a14a785.tar.gz
git-e63ec003b2a0c89f0c1cbc4862dcef7c4a14a785.tar.bz2
user-manual: Document that "git merge" doesn't like uncommited changes.
We explain the user why uncommited changes can be problematic with merge, and point to "commit" and "stash" for the solution. While talking about commited Vs uncommited changes, we also make it clear that the result of a merge is normally commited. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/user-manual.txt')
-rw-r--r--Documentation/user-manual.txt20
1 files changed, 18 insertions, 2 deletions
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 67ebffa..c32dd87 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -1183,7 +1183,23 @@ $ git merge branchname
-------------------------------------------------
merges the development in the branch "branchname" into the current
-branch. If there are conflicts--for example, if the same file is
+branch.
+
+A merge is made by combining the changes made in "branchname" and the
+changes made up to the latest commit in your current branch since
+their histories forked. The work tree is overwritten by the result of
+the merge when this combining is done cleanly, or overwritten by a
+half-merged results when this combining results in conflicts.
+Therefore, if you have uncommitted changes touching the same files as
+the ones impacted by the merge, Git will refuse to proceed. Most of
+the time, you will want to commit your changes before you can merge,
+and if you don't, then linkgit:git-stash[1] can take these changes
+away while you're doing the merge, and reapply them afterwards.
+
+If the changes are independant enough, Git will automatically complete
+the merge and commit the result (or reuse an existing commit in case
+of <<fast-forwards,fast-forward>>, see below). On the other hand,
+if there are conflicts--for example, if the same file is
modified in two different ways in the remote branch and the local
branch--then you are warned; the output may look something like this:
@@ -1679,7 +1695,7 @@ Sharing development with others
Getting updates with git pull
-----------------------------
-After you clone a repository and make a few changes of your own, you
+After you clone a repository and commit a few changes of your own, you
may wish to check the original repository for updates and merge them
into your own work.