BZR version control super quick start

OK, bzr aka Bazaar distributed version control is a replacement for CVS and Subversion (aka svn). It is a very well thought out system that makes it easy to keep track of changes to a file or folder. It also lets multiple people make changes to a file/folder and then merge their changes together.

You can track changes in any kind of file, programming code, office documents, images, web pages or configuration files.

The hardest thing about the program is getting it installed, and that’s not hard. Actually, that’s not true, the hardest thing is understanding distributed version control, but you don’t need to understand it to use it and benefit from it.

Step 1, Download and install it. (Windows, Linux and Mac are all well supported)
Step 2, using a command line, tell Bazaar who you are by typing the command
bzr whoami 'First Last '
Step 3, change to the directory you want to version. So, if you have a folder called Website2007, type
cd Website2007
Step 4, now, tell bzr to keep track of your files: type
bzr init
bzr add

Step 5, whenever you make changes, you’ll have to “commit” them. So, for a website, you may have received a request for a few changes. You can change all your files, then commit the change. You always give a reason for your change, and that can vary from “Changed logo text alignment per CJ’s request” or “Initial commit”. When you type the command to commit your changes, you’ll be prompted to type a your reason. Type:
bzr commit

Your done! Now, something real cool that I learned to do just now, is upload your changes so others can look at them. In your folder you’ll see a new folder named .bzr (you may need to type ls -a to see it on unix like computer systems). You can copy this folder up to a website or ftp server and others can see not only your files, but the entire history of your changes. So, for example, if you copy your folder to http://files.website.com/Website2007 then someone can get a copy for themselves by typing:
bzr branch http://files.website.com/Website2007

You can publish your files using either ftp or sftp using bzr (there are actually a few other options too). When you want to share your changes, type:
bzr push URL
where “URL” is something like ftp://files.website.com/Website2007 (sftp is good too). After you successfully push once, you don’t need to include the URL in future pushes. Just type:
bzr push

So, that’s basic version control in 5 easy steps. Now, if you ever totally mess up your stuff and you need to go back and see what it was like before, you can. There is a quick tutorial on the bazaar website that shows off a few of the other cool features you can use, like comparing the current file to previous versions.

Also, just so you know, you can version any file. It can be a three line text file, or it can be a 100MB Photoshop image.

Leave A Comment