tags:

views:

506

answers:

4

I wonder what the difference is between

bzr checkout ./MyProject MyProject.dev
# later followed by a
cd MyProject.dev
bzr pull ../MyProject

and

bzr get ./MyProject MyProject.dev
# later followed by
cd MyProject.dev
bzr pull

As far I can tell the only difference is:

  1. bzr get sets the pull location.
  2. bzr checkout doesn't set the pull location, so it must be specified the first time you pull.

Are there other differences?

+3  A: 

bzr get creates a branch, whereas bzr checkout creates a checkout. With a checkout, any revisions you commit to MyProject.dev will also be committed to MyProject.

For more detail, see the checkout tutorial.

Adam Glauser
So "bzr checkout" gives same commit behavior as subversion where commit uploads to the server immediately. And "bzr get" gives same commit behavior as git where commits are to be pushed. Is that it?
neoneye
Bazaar checkouts also have the ability to accept a local-only commit, which Subversion does not. Lightweight checkouts are closest to the Subversion model. I can't comment specifically on git, as I haven't used it yet.Another way to use the checkout functionality is to have all of the branches stored locally, then have one directory which you *bzr switch* between branches.
Adam Glauser
Thank you for the link to the "checkout tutorial", it made me realize some things. Especially the "Offline Commit" section about bind/unbind.
neoneye
+3  A: 

In the case of bzr checkout you should not use bzr pull, but should use bzr update instead.

bzr get is alias of bzr branch which is roughly equivalent of git clone.

bialix
Ah, if I hadn't spotted this little answer down here, I'd have posted it myself.
Mez
Always used `bzr branch` myself, but good to know `get` is an alias.
Kristopher Ives
+2  A: 

Basically you have the option of not being tied to the branch you got the code from: if you want a standalone copy use bzr get, if you want to be automatically bound to the original branch: use bzr checkout.

If you change your mind later and want it to behave more like SVN, you can do a bzr bind and any commits you make will automatically be committed to the parent branch.

James
+2  A: 

This is one of the way cool features of Bazaar that doesn't get enough press: the ability for people to work the way that makes them comfortable, even on the same shared repository.

Have some git or other DVCS devotees? Fine. Have them use bzr branch.

Have some old-school svn guys who just can't wrap their heads around all the branching and merging? "Wait...I have to create a branch, do commits, then merge my branch, then push my branch? How stupid, I just want to commit!" Fine. Have them work with bzr checkout.

This type of flexibility is what draws me to Bazaar, despite the fact that git is wildly more popular and faster.

Wade Williams