Getting started with Bazaar Source Control
Posted by Kash Farooq on September 14, 2009
Following on from moving away from subversion, here are some instructions to get you up and running with Bazaar on Windows.
These instructions are generic for any type of file you want to put into source control – however there are one or two Dev Studio/ReSharper/.NET specific comments.
First, let’s install it. I installed bzr 1.18-1 Windows Standalone Installer. I unticked TortoiseBZR – you don’t need it! And I let it add BZR to my PATH.
Create a repository
I created a BZR repository “trunk” on my USB pen drive (mounted as f:).
Open a command prompt and then run the command:
bzr init f:\bzr_repo
Create a personal branch
Do a “checkout” of this repository. In BZR speak, I’m creating a personal branch:
bzr branch f:\bzr_repo c:\dev\bzr_branch
This command created the directories for me.
Add some files
Now you can add some code to your local branch. I exported all my code from my subversion repository into c:\dev\bzr_branch.
Open a command prompt at c:\dev\bzr_branch and run the command:
This added all my code to my local change set. I haven’t touched the trunk on my USB drive.
Commit your file adds
To do a commit, issue the command:
Notepad pops up for me to add some commit comments. Saving the file commits the added files to my local branch.
I still haven’t touched the trunk on my USB drive.
Push your commit to the trunk
Finally, you can send your change set to the trunk on your USB drive:
bzr push f:\bzr_repo
You only have to add f:\bzr_repo for your first push. For subsequent push commands, it uses the last push location provided.
Now we can make some code changes
Go ahead and change some code, add some files, compile and then run the command:
It shows you all the files that you have amended. Unfortunately it also shows you files and folders that you don’t want to commit to source control (obj, bin, ReSharper, etc).
Push your changes back to the central repository
Now that you have ignored files that you don’t need to commit, running the following commands adds the files you do want and commits them locally (with notepad popping up) and then pushes them to your trunk.
bzr add bzr commit bzr push
This article should get you going. I’ll be writing a few more blog posts to discuss merging, renaming files and integrating with a subversion trunk.
2 Responses to “Getting started with Bazaar Source Control”
Sorry, the comment form is closed at this time.