Introducing Bazaar(vcs)

When I started contributing to Ubuntu on launchpad.I came across a version control system popularly used by launchpad developers.It is very easy to use and is flexible and I am going to share some of the basics with  you all 🙂

INTRODUCTION

Bazaar is a distributed revision control system sponsored by Canonical.It is written in Python programming language.

Bazaar give us the ability to track changes for a directory by turning it into something slightly more complicated than a directory that we call a branch. The branch not only stores how the directory looks right now, but also how it looked at various points in the past. Then, when we do something we wish we hadn’t, we can restore the directory to the way it looked at some point in the past.Version control systems give users the ability to save changes to a branch by “committing a revision“. The revision created is essentially a summary of the changes that were made since the last time the tree was saved.

INSTALLING BAZAAR

$sudo apt-get install bzr

Setting an email address via bzr whoami.

For setting a global identity, use

$bzr whoami “Your Name <email@example.com>”

For using a different address for a specific branch, enter the branch folder and use:

$ bzr whoami –branch “Your Name <email@example.com>”
Setting the email address in the ~/.bazaar/bazaar.conf  by adding the following lines.Note that
[DEFAULT] is case sensitive:
[DEFAULT]
email=Your Name <email@isp.com>

CREATING A REPO

$bzr init-repo <repo-name>

CREATING A BRANCH

$bzr init <branch-name>

ADDING FILES

  • Adding all files:

$bzr add

  • Adding a particular file:

$bzr add <filename>

COMMITTING CHANGES

$bzr commit -m “commit-message”

SOME USEFUL BAZAAR COMMANDS

$bzr status     # tells the changes made to the working directory since last revision.

$bzr diff        # shows the full text of changes to all files as a standard unified diff. This can be piped through many
programs such as ‘’patch’‘, ‘’diffstat’‘, ‘’filterdiff” and ‘’colordiff’‘

$bzr log        # shows the history of the branch by browsing its log

UPDATING BRANCH

$bzr merge <url of repo>

then commit changes if you are satisfied with it using

$bzr commit “merged”

PUSHING YOUR BRANCH TO OTHER REPO

$bzr push <url of repo>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s