Using bzr

From Applied Optics Wiki
Jump to: navigation, search

Official Tutorials

See http://doc.bazaar-vcs.org/bzr.1.11/ or more specifically http://doc.bazaar-vcs.org/bzr.1.11/en/tutorials/tutorial.html

Don't know why you want revision control? See the second link above. You really do want it. Example of things you could use it for: Matlab code, C code, VHDL code (or a whole Xilinx project!), your thesis, any other documents you are writing, Eagle PCB designs, ... This is even more true if you are doing work that is between a number of people. You'll be able to see who made what changes and not worry about changing something that somebody else is working on.

Quick List of Commands

To see some help:

bzr help

To ensure that your commits have the correct name (run once before anything else):

bzr whoami "My Name <my.email@example.com>"

To create a new repository:

mkdir example
cd example
bzr init

To add a file to the repository (don't forget to commit the changes afterwards):

bzr add example.c

To commit changes to a file after modifying it:

bzr ci example.c

To commit changes to the whole repository:

bzr ci

To move/rename a file (don't forget to commit the changes afterwards):

bzr mv <old file> <new file>

To remove a file (don't forget to commit the changes afterwards):

bzr rm <file>

To see uncommited changes in the current repository/file:

bzr diff [filename]

To see the revision log:

bzr log [filename]

To see the current state of the repository:

bzr st
# or
bzr status

To ignore files so they aren't considered in "bzr st" and other commands (don't forget to commit the changes afterwards):

bzr ignore <filename>

To give a meaningful name to a revision (ie. to tag a particular released version):

bzr tag <tag name>

To create a copy of the repository:

bzr branch <existing repo> <new repo>

To merge changes from one repo to another:

cd my_repo
bzr merge /path/to/other/repo