简体   繁体   中英

What exactly does hg pull do?

I'm using Mercurial. What exactly does hg pull do and what other steps need to be in my workflow after I use it?

The main clone is called "farm". I made a clone of it called "myfarm" which I've been developing locally. Now I want to push the changes from my clone to the real clone hosted at googlecode.

So in the context of my own clone "myfarm", I run [hg incoming farm]. This seems to list all the changes that have been made to "farm" since I made my clone of it. Lists a bunch of stuff like:

changeset:   545:edfe4dadf
parent:      549:ea8e55929bcF
parent:      592:dfdf05dbcfA3
user:        Some user
date:        Some date
summary:     Some comments

ok so then I ran [hg pull farm]. I'm left with the following at the command prompt:

pulling from https://blah.googlecode.com/hg
searching for changes
adding changesets
adding manifests
adding file changes
added 6 changesets with 3 changes to 2 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)

Questions:

  • Is everything merged for me already, or do I need to run hg merge farm now?

  • How will I know if there are conflicts? If so, I'm also not sure if I have to run:

.

hg merge farm
hg merge

I mean, I want to merge the results of the pull, but am not sure which of the above two is appropriate.


I'm used to using svn, so in this case, I would have just done:

svn update (notified of merge changes)
svn ci

Thanks

In the case you've described, you would run hg merge . pull is just a synchronization step, it doesn't modify the local working folders not add any merges or so any other real work.

Joel Spolsky has recently published a good tutorial on version control with Subversion at http://hginit.com . I would suggest having a read through this if you're still not quite up to speed with the concepts. I would recommend reading through the tutorial sequentially (rather than skipping to the "Merge" page) because the examples he uses build upon one another and will be easier to follow if you've read the previous sections.

Hg has an svnbook too .
Chapter 3 clearly explains your problem.

hg merge is indeed what I would do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM