bzr pull vs. bzr update

John Arbash Meinel john at arbash-meinel.com
Wed Dec 16 20:50:50 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Karl Fogel wrote:
> John Arbash Meinel <john at arbash-meinel.com> writes:
>> If you are working in a checkout, 'update' is the recommended command.
>> For your specific use cases "bzr update" is equivalent to "bzr pull
>> $MASTER". The divergence between them is mostly around what happens if
>> you have local commits, etc.
>>
>> There are other reasons as well. For example "cd checkout; bzr pull
>> $NOT_MASTER". Will turn your master branch into $NOT_MASTER, as well as
>> your local checkout. Which has valid use cases, but infrequent. At least
>> IMO, using 'bzr update' is a different mental request than 'bzr pull'.
> 
> Well, we are working in a checkout here (because 'bzr bind' would have
> been done earlier).  But we are just recommending 'bzr pull' with no
> arguments, not 'bzr pull <MASTER>'.
> 
> I didn't have any compelling reason to specify 'pull' instead of
> 'update'; it's just that 'pull' is what I'm in the habit of using
> myself.
> 
> 'bzr help update' indicates that it will not error if there are local
> changes -- instead, it may generate conflicts.  On the other hand, the
> help for 'bzr pull' is silent on that subject, but my memory is that it
> will error if there are local mods.  Although in an experiment just now,
> where I did a pull when there were no changes to pull down, it did *not*
> error in the presence of local changes.
> 
> So I don't know.  If my belief about pull's behavior is wrong anyway,
> then maybe that page should just recommend update?
> 
> -K
> 

If you have *local commits* pull will abort with diverged branches,
while update will turn your local commits into a merge into the new tip.
That is the primary difference between pull and update. Both preserve
working tree changes and allow them to be present.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkspSCoACgkQJdeBCYSNAANYTACeKdVyi+cPUcdQDqQGI2rDIjpo
pSAAn3k06WjCoua2e00FpDNl2oxhmKK6
=LB1t
-----END PGP SIGNATURE-----



More information about the bazaar mailing list