Results 1 to 6 of 6

Thread: Beginners Guide to Bazaar

  1. #1
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Beginners Guide to Bazaar

    A Beginner's Guide to Bazaar
    ░▒▓»§«▓▒░


    Introduction

    Bazaar (or bzr) is a project of Canonical to develop an open source distributed version control system that is powerful, friendly, and scalable. ... It is used by Launchpad for managing revisions with packages. If you have never created a Launchpad project because bzr scared you, fear no more!

    To get started, you should install the bzr application by running:
    Code:
    sudo apt-get install bzr
    Bazaar relies on SSH keys to transfer files to your Launchpad account. If you don't have a SSH key, you can follow the next steps to get your SSH key on Launchpad. If you already have your SSH key on Launchpad, you can skip this section to "Using Bazaar".

    Launchpad / SSH Key

    To create your SSH key, open a terminal and run:
    Code:
    ssh-keygen -t dsa
    Leave the first prompt (for the key location) at default, by pressing Enter, then enter a passphrase for your private SSH key. When complete, run:
    Code:
    cat ~/.ssh/id_dsa.pub
    Copy your public key, from the previous command, then go to Launchpad to edit your SSH key:
    https://launchpad.net/~username/+editsshkeys

    Paste the key into "Add an SSH key" then click "Import Public Key". You should be all set now!


    Using Bazaar

    Suppose you found a project on Launchpad, that you wanted to help out with, or wanted to download their project source to tweak it to your own likings. I'll give my perlbot project as a quick example. If you go to:
    https://code.launchpad.net/~drsmall/perlbot/trunk

    You can view the trunk, and revisions for that project. If you wanted to download a copy of this trunk to your local system, you would issue this command:
    Code:
    bzr pull lp:perlbot
    This would then download the source files of perlbot to ~/perlbot on your system. You can then execute, run, or send the revisions back to the trunk (with proper permission).

    Ok. So let's say you want to start your own branch, where you can host your own edited version of some software, or it could be something you created by yourself that you want to be worked on by a team. Gather up all of the files you want to placed in your launchpad branch, and place them in one directory. cd to this directory, and then run:
    Code:
    bzr init
    This makes the directory into a version branch. If you take the time to notice, there is now a hidden directory called .bzr in here. This is where all the revisions, and files are stored to be used by bzr. Now, add all of the files to the branch:
    Code:
    bzr add *
    It is a good idea to get in the habit of running the next command for checking the difference between your last revision and the current one. You shouldn't have to do this on your first time around, though.
    Code:
    bzr diff
    With this next step, we are committing our edits into the current revision. It is a good idea to label your revisions with meaningful comments.
    Code:
    bzr commit -m "Revision 1 Comment"
    You may now upload your revision to your Launchpad branch. If the branch does not exist, it will be created. You can have multiple branches, so name them accordingly. This command may take a few minutes, but it is creating the branch, uploading your files, creating revisions and alot of other things.
    Code:
    bzr push lp:~user/projectname/branchname

    Commands

    Make directory a bzr branch:
    Code:
    bzr init
    Download a branch:
    Code:
    bzr pull <location>
    Update a branch:
    Code:
    bzr push <location>
    Add files to branch:
    Code:
    bzr add <filename>
    Check the difference between revisions:
    Code:
    bzr diff
    Commit the revision:
    Code:
    bzr commit -m "Revision Comment"
    (These are just the basic commands. You can find the complete list of commands by running 'man bzr' in your terminal.)




    Additional Links:
    Bzr - Ubuntu Wiki
    Bazaar Official Website
    Launchpad.net

    Dr Small
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  2. #2
    -grubby is offline May the Ubuntu Be With You!
    Join Date
    Aug 2007
    Beans
    Hidden!

    Re: Beginners Guide to Bazaar

    Thank you.. this guide is very helpful
    Last edited by -grubby; December 18th, 2008 at 06:14 PM.

  3. #3
    Join Date
    Mar 2008
    Location
    Cardiff, UK
    Beans
    425
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Beginners Guide to Bazaar

    I've got a question, what exactly is the difference between bzr pull and bzr branch?

  4. #4
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Beginners Guide to Bazaar

    Quote Originally Posted by Flimm View Post
    I've got a question, what exactly is the difference between bzr pull and bzr branch?
    I think that 'bzr branch location' will create the current directory into a branch and download the branch, whereas 'bzr pull location' will only pull the branch to the directory, without setting up a local branch.

    Dr Small
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  5. #5
    Join Date
    Nov 2007
    Location
    Canton, Michigan
    Beans
    74
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Beginners Guide to Bazaar

    wow great work here doc

  6. #6
    Join Date
    Mar 2012
    Beans
    1

    Re: Beginners Guide to Bazaar

    Hi, I'm very new to Baazar, and I was invited to an existing project in Launchpad.net. Do you know if there is a way to import a branch (for an existing project that has its own account in Baazar) without installing Baazar on my computer, just using the existing host?

    I'm not a fluent speaker of English, so let me know if there is something wrong with my question and I'll clarify it.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •