Git development
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH 2/2 v2] user-manual: Document that "git merge" doesn't like uncommited changes.
Date: Sun, 22 Nov 2009 23:26:18 +0100	[thread overview]
Message-ID: <1258928778-32419-2-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <1258732767-12741-1-git-send-email-Matthieu.Moy@imag.fr>

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>
---
 Documentation/user-manual.txt |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 269ec47..c09f4b2 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.
 
-- 
1.6.5.3.435.g5f2e3.dirty

  parent reply	other threads:[~2009-11-22 22:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 15:59 [RFC/PATCH 0/2] Explain newbies the "commit before pull" flow Matthieu Moy
2009-11-20 15:59 ` [PATCH 1/2] merge-recursive: point the user to commit when file would be overwritten Matthieu Moy
2009-11-20 18:05   ` Junio C Hamano
2009-11-22 22:09     ` Matthieu Moy
2009-11-20 15:59 ` [PATCH 2/2] user-manual: Document that "git merge" doesn't like uncommited changes Matthieu Moy
2009-11-20 20:19   ` Junio C Hamano
2009-11-22 22:18     ` Matthieu Moy
2009-11-22 23:57       ` Junio C Hamano
2009-11-23  7:51         ` Matthieu Moy
2009-11-22 22:26 ` [PATCH 1/2 v2] merge-recursive: point the user to commit when file would be overwritten Matthieu Moy
2009-11-22 22:26 ` Matthieu Moy [this message]
2009-11-23  0:08   ` [PATCH 2/2 v2] user-manual: Document that "git merge" doesn't like uncommited changes Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258928778-32419-2-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox