From: Steven Grimm Date: Sun, 14 Oct 2007 19:25:27 GMT Subject: Re: Git User's Survey 2007 unfinished summary continued Message-ID: <47126D27.4060409@midwinter.com> In-Reply-To: <20071014184050.GB31260@fieldses.org> J. Bruce Fields wrote: > I'm lost--how is "hg pull" different from "git pull" in this respect? > (Pedantry alert: "hg pull" is equivalent to "git fetch" and doesn't update the working copy. I'll talk here about the "hg pull; hg update" pair which seems to be standard procedure in hg land.) Here's a simple example in each system to demonstrate the difference. --- mkdir parent cd parent git init echo 'my baloney has a first name' > song.txt echo "it's o-s-c-a-r" >> song.txt echo 'my baloney has a last name' >> song.txt git add song.txt git commit -m "test file" cd .. git clone parent child cd parent echo "it's m-a-y-e-r" >> song.txt git commit -a -m "another line in the song" cd ../child perl -pi -e 's/first name/given name/' song.txt git pull --- Result: "fatal: Entry 'song.txt not uptodate. Cannot merge." --- mkdir hgparent cd hgparent hg init echo 'my baloney has a first name' > song.txt echo "it's o-s-c-a-r" >> song.txt echo 'my baloney has a last name' >> song.txt hg add song.txt hg commit -m "test file" cd .. hg clone hgparent hgchild cd hgparent echo "it's m-a-y-e-r" >> song.txt hg commit -m "another line in the song" cd ../hgchild perl -pi -e 's/first name/given name/' song.txt hg pull hg update --- Result: "0 files updated, 1 files merged, 0 files removed, 0 files unresolved" and the file contains the change from the parent plus the change from the child, with the latter still an uncommitted edit that shows up in "hg diff". -Steve