Difference between revisions of "User talk:Rtownsend"
Line 11: | Line 11: | ||
=Using Bazaar= |
=Using Bazaar= |
||
Note: You can install Bazaar from here[http://bazaar.canonical.com/en/]. |
Note: You can install Bazaar from here[http://bazaar.canonical.com/en/]. |
||
+ | |||
+ | == Setting up Bazaar== |
||
+ | Before you can commit using Bazaar, you'll need to tell it who you are. To do this, type '''bzr whoami "name <email]>"''' e.g. '''bzr whoami "Richard Townsend <Richard.Townsend@warwick.ac.uk>"''. |
||
+ | |||
+ | ==Command-line== |
||
Most people work with Bazaar through the command line, which runs on Windows, Mac and Linux. The command for Bazaar is '''bzr''' Running '''bzr''' on its own gives you this: |
Most people work with Bazaar through the command line, which runs on Windows, Mac and Linux. The command for Bazaar is '''bzr''' Running '''bzr''' on its own gives you this: |
Revision as of 12:44, 13 November 2010
Contents
About Bazaar
Bazaar is a distributed source control system, similar to git or mercurial. It's used on the various projects embarked upon by the IT team. Bazaar
- keeps track of every old version of every file and
- merges different versions of the code, so that team-mates can work independently on the code and merge their changes later.
Bazaar differs from Subversion
Instead of simply storing snapshots of files, like Subversion, Bazaar stores a list of changes made to every file since it was added to the repository.
Using Bazaar
Note: You can install Bazaar from here[1].
Setting up Bazaar
Before you can commit using Bazaar, you'll need to tell it who you are. To do this, type bzr whoami "name <email]>"' e.g. bzr whoami "Richard Townsend <Richard.Townsend@warwick.ac.uk>".
Command-line
Most people work with Bazaar through the command line, which runs on Windows, Mac and Linux. The command for Bazaar is bzr Running bzr on its own gives you this:
richard-townsends-macbook:htdocs anonymous500r$ bzr Bazaar 2.2.0 -- a free distributed version-control tool http://www.bazaar.canonical.com/ Basic commands: bzr init makes this directory a versioned branch bzr branch make a copy of another branch bzr add make files or directories versioned bzr ignore ignore a file or pattern bzr mv move or rename a versioned file bzr status summarize changes in working copy bzr diff show detailed diffs bzr merge pull in changes from another branch bzr commit save some or all changes bzr send send changes via email bzr log show history of changes bzr check validate storage bzr help init more help on e.g. init command bzr help commands list all commands bzr help topics list all help topics
Workflow: Checking out
In bazaar, checking out gives you a complete copy of the repository, containing everyone's changes from forever. Bazaar can checkout over sftp to your local computer, or from another part of the server (if you're logged in using a shell). The syntax for the command is bzr checkout remote_path [local path]
richard-townsends-macbook:htdocs anonymous500r$ bzr checkout sftp://csukak@filmsoc.warwick.ac.uk//srv/bzr/website-v3-php/dev /Applications/MAMP/htdocs csukak@filmsoc.warwick.ac.uk's password: Format RepositoryFormatKnit1() for file:///Applications/MAMP/htdocs/.bzr/ is deprecated - please use 'bzr upgrade' to get better performance richard-townsends-macbook:htdocs anonymous500r$
Workflow: Making changes
Once you've checked out the repository, you can then get to work! Bazaar will notice if you change any of the files it tracks. You can see what's going on at any time using the bzr status command.
richard-townsends-macbook:htdocs anonymous500r$ bzr status modified: process.php
Don't be afraid to commit! Even if your code doesn't work yet, it's a great way of saving where you are. An additional benefit of using Bazaar is that you can use version control without making your changes available to anyone else until they're ready. To commit the change to my local repository, I type bzr commit.