annotate help/topics/33.txt @ 532:06507a59f2b8 easyhg_v1.1

This will do for the Merge topic
author Chris Cannam
date Wed, 23 Nov 2011 17:24:47 +0000
parents f56e5c39aad1
children
rev   line source
Chris@499 1 {Sharing changes}
Chris@499 2
Chris@499 3 I tried to push my changes, but it told me "the remote repository may have been changed by someone else" and refused
Chris@499 4
Chris@500 5 This indicates that the remote repository has some changes in it that
Chris@500 6 you do not have in your local repository (and that are in branches
Chris@500 7 that you have also changed).
Chris@500 8
Chris@500 9 Perhaps someone else made these changes and pushed them, or they may
Chris@500 10 have been pushed by you from a different computer.
Chris@500 11
Chris@500 12 *Why should that prevent me from pushing my changes?*
Chris@499 13
Chris@499 14 A good principle is that you should review and test your changes
Chris@500 15 before you push them to another repository. It may be OK to commit
Chris@499 16 changes locally that don't really work or that aren't complete enough
Chris@500 17 to test, but it's a bad idea to push anything that would cause the
Chris@500 18 remote repository to have an untested set of changes in it.
Chris@499 19
Chris@500 20 For this reason, if you change some files, someone else changes some
Chris@500 21 others, and you both try to push them without knowing about the other
Chris@500 22 one, Mercurial must refuse the second push -- it can't simply merge
Chris@500 23 the changes because the result might not make any sense.
Chris@499 24
Chris@499 25 Instead you must pull the other person's changes and merge them
Chris@500 26 locally before you push. Fortunately, this is easy to do:
Chris@499 27
Chris@499 28 *1. Click Pull on the main toolbar at the top of the EasyMercurial window.*
Chris@499 29
Chris@499 30 * You should see that some changes are pulled and added to your local repository. This will usually lead to a forked graph in the History pane, as your changes and the other user's were both started from the same parent at the same time.
Chris@499 31
Chris@499 32 *2. Click Merge in the toolbar on the left.*
Chris@499 33
Chris@531 34 * Any changes that affect different files, or that affect different parts of the same file, will be merged automatically. For changes that affect the same parts of the same file, you will be asked to choose which change to include in the merged copy. See [[34|How do I merge my changes...]] for more about this.
Chris@499 35
Chris@499 36 *3. Review or test the resulting merged version in your local working folder.*
Chris@499 37
Chris@499 38 *4. Commit the merged version.*
Chris@499 39
Chris@499 40 *5. Push again to the remote repository.*
Chris@499 41