We explain the user why uncommited changes can be problematic with merge, and point to "commit" and "stash" for the solution. Signed-off-by: Matthieu Moy <Matthieu.Moy@xxxxxxx> --- Documentation/user-manual.txt | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 269ec47..6b4a037 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -1176,14 +1176,22 @@ How to merge ------------ You can rejoin two diverging branches of development using -linkgit:git-merge[1]: +linkgit:git-merge[1]. ------------------------------------------------- $ 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. Note that Git merges committed changes, but not the working +tree itself. 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 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 +1687,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 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html