aboutsummaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-12-03 13:52:54 -0800
committerJunio C Hamano <gitster@pobox.com>2009-12-03 13:52:54 -0800
commit24807f9d5bada2475fddd153365c1debfe1309bc (patch)
tree5a16341ed3e937e0af47f57a6acbebe0df18f9cb /Documentation
parentd718c19bc686a15ed69cd7631e50613dd4901e03 (diff)
parente63ec003b2a0c89f0c1cbc4862dcef7c4a14a785 (diff)
downloadgit-24807f9d5bada2475fddd153365c1debfe1309bc.tar.gz
git-24807f9d5bada2475fddd153365c1debfe1309bc.tar.xz
Merge branch 'mm/maint-hint-failed-merge' into maint
* mm/maint-hint-failed-merge: user-manual: Document that "git merge" doesn't like uncommited changes. merge-recursive: point the user to commit when file would be overwritten.
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config.txt4
-rw-r--r--Documentation/user-manual.txt20
2 files changed, 22 insertions, 2 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 35e72e4a3..35e26972e 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -126,6 +126,10 @@ advice.*::
Directions on how to stage/unstage/add shown in the
output of linkgit:git-status[1] and the template shown
when writing commit messages. Default: true.
+ commitBeforeMerge::
+ Advice shown when linkgit:git-merge[1] refuses to
+ merge to avoid overwritting local changes.
+ Default: true.
--
core.fileMode::
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 67ebffa56..c32dd87c8 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.