5

I am a git user but now I need to work on a project that is hosted on launchpad.

I noticed that git and bzr are similar but apparently have some confusing differences.

In git when you clone a remote repo the local copy is automatically hooked to the remote repo url. Apparently this is not the case in Bzr.

So how do I add the remote URL in bzr? In git I would do something like this:

git remote add origin git@github.com:bar/foo.git
Francisco Luz
  • 2,775
  • 2
  • 25
  • 35

2 Answers2

5

When you use bzr branch lp:project that sets the parent branch for the local repo to the URL you specified. bzr pull will automatically use the parent branch, but bzr push requires that you specify the parent if you want to push to the parent, like so: bzr push :parent. You can add the --remember option to the push command to set the push branch so that you don't have to specify the :parent every time. You can see what the parent, push and pull branches are for your local repo using the bzr info command.

dOxxx
  • 1,540
  • 1
  • 12
  • 28
  • +1 for adding (a nice) answer even when an answer was already accepted. – TridenT Mar 30 '13 at 10:11
  • 1
    Once you successfully push somewhere, Bazaar automatically remembers that location. The `--remember` flag is useful if you want to change the saved push location to a different one. – janos Apr 06 '13 at 17:27
1

In BAZAAR, this operation is called bind.
http://doc.bazaar.canonical.com/beta/en/user-reference/bind-help.html

bzr bind lp:~bzr/bzr-gtk/trunk

When I'm doing a checkout (branch) with TortoiseBzr, my working copy is automaticcaly bind to the branch origin.

TridenT
  • 4,879
  • 1
  • 32
  • 56
  • 4
    Bear in mind that *bind* is not the same as adding a git remote. Binding to a remote repo means that every commit you make in your local repo will first be made in the remote repo. It's the equivalent of a SVN model. – dOxxx Mar 29 '13 at 22:53