man bzr (Commandes) - bazaar-ng next-generation distributed version control

NAME

bzr - bazaar-ng next-generation distributed version control

SYNOPSIS

bzr command [ command_options ]

bzr help

bzr help command

DESCRIPTION

bazaar-ng (or bzr ) is a project of Canonical to develop an open source distributed version control system that is powerful, friendly, and scalable. Version control means a system that keeps track of previous revisions of software source code or similar information and helps people work on it in teams.

COMMAND OVERVIEW

bzr add [FILE...]
Add specified files or directories.
bzr annotate FILENAME
Show the origin of each line in a file.
bzr bind LOCATION
Bind the current branch to a master branch.
bzr branch FROM_LOCATION [TO_LOCATION]
Create a new copy of a branch.
bzr break-lock [LOCATION]
Break a dead lock on a repository, branch or working directory.
bzr cat FILENAME
Write a file's text from a previous revision.
bzr check [BRANCH]
Validate consistency of branch history.
bzr checkout [BRANCH_LOCATION] [TO_LOCATION]
Create a new checkout of an existing branch.
bzr commit [SELECTED...]
Commit changes into a new revision.
bzr conflicts
List files with conflicts.
bzr deleted
List files deleted in the working tree.
bzr diff [FILE...]
Show differences in working tree.
bzr export DEST
Export past revision to destination directory.
bzr help [TOPIC]
Show help on a command or other topic.
bzr ignore NAME_PATTERN
Ignore a command or pattern.
bzr ignored
List ignored files and the patterns that matched them.
bzr info [LOCATION]
Show information about a working tree, branch or repository.
bzr init [LOCATION]
Make a directory into a versioned branch.
bzr init-repository LOCATION
Create a shared repository to hold branches.
bzr inventory
Show inventory of the current working copy or a revision.
bzr log [LOCATION]
Show log of a branch, file, or directory.
bzr merge [BRANCH]
Perform a three-way merge.
bzr missing [OTHER_BRANCH]
Show unmerged/unpulled revisions between two branches.
bzr mkdir DIR...
Create a new versioned directory.
bzr mv [NAMES...]
Move or rename a file.
bzr nick [NICKNAME]
Print or set the branch nickname.
bzr pull [LOCATION]
Turn this branch into a mirror of another branch.
bzr push [LOCATION]
Update a mirror of this branch.
bzr reconcile [BRANCH]
Reconcile bzr metadata in a branch.
bzr remerge [FILE...]
Redo a merge.
bzr remove FILE...
Make a file unversioned.
bzr renames [DIR]
Show list of renamed files.
bzr resolve [FILE...]
Mark a conflict as resolved.
bzr revert [FILE...]
Reverse all changes since the last commit.
bzr revno [LOCATION]
Show current revision number.
bzr root [FILENAME]
Show the tree root directory.
bzr sign-my-commits [LOCATION] [COMMITTER]
Sign all commits by a given committer.
bzr status [FILE...]
Display status summary.
bzr testament [BRANCH]
Show testament (signing-form) of a revision.
bzr unbind
Unbind the current branch from its master branch.
bzr uncommit [LOCATION]
Remove the last committed revision.
bzr unknowns
List unknown files.
bzr update [DIR]
Update a tree to have the latest code committed to its branch.
bzr upgrade [URL]
Upgrade branch storage to current format.
bzr version
Show version of bzr.
bzr whoami
Show bzr user id.

COMMAND REFERENCE

bzr add [FILE...]

Options: --dry-run show what would be done, but don't actually do anything --help, -h show help message --no-recurse --verbose, -v display more information

Add specified files or directories.

In non-recursive mode, all the named items are added, regardless of whether they were previously ignored. A warning is given if any of the named files are already versioned.

In recursive mode (the default), files are treated the same way but the behaviour for directories is different. Directories that are already versioned do not give a warning. All directories, whether already versioned or not, are searched for files or subdirectories that are neither versioned or ignored, and these are added. This search proceeds recursively into versioned directories. If no names are given '.' is assumed.

Therefore simply saying 'bzr add' will version all files that are currently unknown.

Adding a file whose parent directory is not versioned will implicitly add the parent, and so on up to the root. This means you should never need to explictly add a directory, they'll just get added when you add a file in the directory.

--dry-run will show which files would be added, but not actually add them.

bzr annotate FILENAME

Options: --all show annotations on all lines --help, -h show help message --long show date in annotations --revision ARG, -r

Show the origin of each line in a file.

This prints out the given file with an annotation on the left side indicating which revision, author and date introduced the change.

If the origin is the same for a run of consecutive lines, it is shown only at the top, unless the --all option is given.

bzr bind LOCATION

Options: --help, -h show help message

Bind the current branch to a master branch.

After binding, commits must succeed on the master branch before they are executed on the local one.

bzr branch FROM_LOCATION [TO_LOCATION]

Options: --basis ARG --help, -h show help message --revision ARG, -r

Create a new copy of a branch.

If the TO_LOCATION is omitted, the last component of the FROM_LOCATION will be used. In other words, "branch ../foo/bar" will attempt to create ./bar.

To retrieve the branch as of a particular revision, supply the --revision parameter, as in "branch foo/bar -r 5".

--basis is to speed up branching from remote branches. When specified, it copies all the file-contents, inventory and revision data from the basis branch before copying anything from the remote branch.

bzr break-lock [LOCATION]

Options: --help, -h show help message

Break a dead lock on a repository, branch or working directory.

CAUTION: Locks should only be broken when you are sure that the process holding the lock has been stopped.

You can get information on what locks are open via the 'bzr info' command.

example: bzr break-lock

bzr cat FILENAME

Options: --help, -h show help message --revision ARG, -r

Write a file's text from a previous revision.

bzr check [BRANCH]

Options: --help, -h show help message --verbose, -v display more information

Validate consistency of branch history.

This command checks various invariants about the branch storage to detect data corruption or bzr bugs.

bzr checkout [BRANCH_LOCATION] [TO_LOCATION]

Options: --help, -h show help message --lightweight perform a lightweight checkout. Lightweight checkouts depend on access to the branch for every operation. Normal checkouts can perform common operations like diff and status without such access, and also support local commits. --revision ARG, -r

Create a new checkout of an existing branch.

If BRANCH_LOCATION is omitted, checkout will reconstitute a working tree for the branch found in '.'. This is useful if you have removed the working tree or if it was never created - i.e. if you pushed the branch to its current location using SFTP.

If the TO_LOCATION is omitted, the last component of the BRANCH_LOCATION will be used. In other words, "checkout ../foo/bar" will attempt to create ./bar.

To retrieve the branch as of a particular revision, supply the --revision parameter, as in "checkout foo/bar -r 5". Note that this will be immediately out of date [so you cannot commit] but it may be useful (i.e. to examine old code.)

--basis is to speed up checking out from remote branches. When specified, it uses the inventory and file contents from the basis branch in preference to the branch being checked out.

bzr commit [SELECTED...]

Options: --file MSGFILE file containing commit message --help, -h show help message --local perform a local only commit in a bound branch. Such commits are not pushed to the master branch until a normal commit is performed. --message ARG, -m --strict refuse to commit if there are unknown files in the working tree. --unchanged commit even if nothing has changed --verbose, -v display more information

Commit changes into a new revision.

If no arguments are given, the entire tree is committed.

If selected files are specified, only changes to those files are committed. If a directory is specified then the directory and everything within it is committed.

A selected-file commit may fail in some cases where the committed tree would be invalid, such as trying to commit a file in a newly-added directory that is not itself committed.

bzr conflicts

Options: --help, -h show help message

List files with conflicts.

Merge will do its best to combine the changes in two branches, but there are some kinds of problems only a human can fix. When it encounters those, it will mark a conflict. A conflict means that you need to fix something, before you should commit.

Use bzr resolve when you have fixed a problem.

(conflicts are determined by the presence of .BASE .TREE, and .OTHER files.)

See also bzr resolve.

bzr deleted

Options: --help, -h show help message

List files deleted in the working tree.

bzr diff [FILE...]

Options: --diff-options ARG --help, -h show help message --prefix ARG, -p Set prefixes to added to old and new filenames, as two values separated by a colon. --revision ARG, -r

Show differences in working tree.

If files are listed, only the changes in those files are listed. Otherwise, all changes for the tree are listed.

"bzr diff -p1" is equivalent to "bzr diff --prefix old/:new/", and produces patches suitable for "patch -p1".

examples: bzr diff bzr diff -r1 bzr diff -r1..2 bzr diff --diff-prefix old/:new/ bzr diff bzr.mine bzr.dev bzr diff foo.c

bzr export DEST

Options: --format ARG --help, -h show help message --revision ARG, -r --root ARG

Export past revision to destination directory.

If no revision is specified this exports the last committed revision.

Format may be an "exporter" name, such as tar, tgz, tbz2. If none is given, try to find the format with the extension. If no extension is found exports to a directory (equivalent to --format=dir).

Root may be the top directory for tar, tgz and tbz2 formats. If none is given, the top directory will be the root name of the file.

Note: export of tree with non-ascii filenames to zip is not supported.

Supported formats Autodetected by extension ----------------- ------------------------- dir - tar .tar tbz2 .tar.bz2, .tbz2 tgz .tar.gz, .tgz zip .zip

bzr help [TOPIC]

Options: --help, -h show help message --long show help on all commands

Show help on a command or other topic.

For a list of all available commands, say 'bzr help commands'.

bzr ignore NAME_PATTERN

Options: --help, -h show help message

Ignore a command or pattern.

To remove patterns from the ignore list, edit the .bzrignore file.

If the pattern contains a slash, it is compared to the whole path from the branch root. Otherwise, it is compared to only the last component of the path. To match a file only in the root directory, prepend './'.

Ignore patterns are case-insensitive on case-insensitive systems.

Note: wildcards must be quoted from the shell on Unix.

examples: bzr ignore ./Makefile bzr ignore '*.class'

bzr ignored

Options: --help, -h show help message

List ignored files and the patterns that matched them.

See also: bzr ignore

bzr info [LOCATION]

Options: --help, -h show help message --verbose, -v display more information

Show information about a working tree, branch or repository.

This command will show all known locations and formats associated to the tree, branch or repository. Statistical information is included with each report.

Branches and working trees will also report any missing revisions.

bzr init [LOCATION]

Options: --format ARG Specify a format for this branch. Current formats are: default, knit, metaweave and weave. Default is knit; metaweave and weave are deprecated --help, -h show help message

Make a directory into a versioned branch.

Use this to create an empty branch, or before importing an existing project.

If there is a repository in a parent directory of the location, then the history of the branch will be stored in the repository. Otherwise init creates a standalone branch which carries its own history in

If there is already a branch at the location but it has no working tree, the tree can be populated with 'bzr checkout'.

Recipe for importing a tree of files: cd ~/project bzr init bzr add . bzr status bzr commit -m 'imported project'

bzr init-repository LOCATION

Options: --format ARG Specify a format for this repository. Current formats are: default, knit, metaweave and weave. Default is knit; metaweave and weave are deprecated --help, -h show help message --trees Allows branches in repository to have a working tree

Create a shared repository to hold branches.

New branches created under the repository directory will store their revisions in the repository, not in the branch directory, if the branch format supports shared storage.

example: bzr init-repo repo bzr init repo/trunk bzr checkout --lightweight repo/trunk trunk-checkout cd trunk-checkout (add files here)

bzr inventory

Options: --help, -h show help message --kind ARG --revision ARG, -r --show-ids show internal object ids

Show inventory of the current working copy or a revision.

It is possible to limit the output to a particular entry type using the --kind option. For example; --kind file.

bzr log [LOCATION]

Options: --forward show from oldest to newest --help, -h show help message --line Use log format with one line per revision. Same as --log-format line --log-format ARG Use this log format --long, -l Use detailed log format. Same as --log- format long --message ARG show revisions whose message matches this regexp --revision ARG, -r --short Use moderately short log format. Same as --log-format short --show-ids show internal object ids --timezone ARG display timezone as local, original, or utc --verbose show files changed in each revision

Show log of a branch, file, or directory.

By default show the log of the branch containing the working directory.

To request a range of logs, you can use the command -r begin..end -r revision requests a specific revision, -r ..end or -r begin.. are also valid.

examples: bzr log bzr log foo.c bzr log -r -10.. http://server/branch

bzr merge [BRANCH]

Options: --force --help, -h show help message --merge-type ARG --remember Remember the specified location as a default. --reprocess Reprocess to reduce spurious conflicts --revision ARG, -r --show-base Show base revision text in conflicts

Perform a three-way merge.

The branch is the branch you will merge from. By default, it will merge the latest revision. If you specify a revision, that revision will be merged. If you specify two revisions, the first will be used as a BASE, and the second one as OTHER. Revision numbers are always relative to the specified branch.

By default, bzr will try to merge in all new work from the other branch, automatically determining an appropriate base. If this fails, you may need to give an explicit base.

Merge will do its best to combine the changes in two branches, but there are some kinds of problems only a human can fix. When it encounters those, it will mark a conflict. A conflict means that you need to fix something, before you should commit.

Use bzr resolve when you have fixed a problem. See also bzr conflicts.

If there is no default branch set, the first merge will set it. After that, you can omit the branch to use the default. To change the default, use --remember.

Examples:

To merge the latest revision from bzr.dev bzr merge ../bzr.dev

To merge changes up to and including revision 82 from bzr.dev bzr merge -r 82 ../bzr.dev

To merge the changes introduced by 82, without previous changes: bzr merge -r 81..82 ../bzr.dev

merge refuses to run if there are any uncommitted changes, unless --force is given.

bzr missing [OTHER_BRANCH]

Options: --help, -h show help message --line Use log format with one line per revision. Same as --log-format line --log-format ARG Use this log format --long, -l Use detailed log format. Same as --log- format long --mine-only Display changes in the local branch only --reverse Reverse the order of revisions --short Use moderately short log format. Same as --log-format short --show-ids show internal object ids --theirs-only Display changes in the remote branch only --verbose, -v display more information

Show unmerged/unpulled revisions between two branches.

OTHER_BRANCH may be local or remote.

bzr mkdir DIR...

Options: --help, -h show help message

Create a new versioned directory.

This is equivalent to creating the directory and then adding it.

bzr mv [NAMES...]

Options: --help, -h show help message

Move or rename a file.

usage: bzr mv OLDNAME NEWNAME bzr mv SOURCE... DESTINATION

If the last argument is a versioned directory, all the other names are moved into it. Otherwise, there must be exactly two arguments and the file is changed to a new name, which must not already exist.

Files cannot be moved between branches.

bzr nick [NICKNAME]

Options: --help, -h show help message

Print or set the branch nickname.

If unset, the tree root directory name is used as the nickname To print the current nickname, execute with no argument.

bzr pull [LOCATION]

Options: --help, -h show help message --overwrite Ignore differences between branches and overwrite unconditionally --remember Remember the specified location as a default. --revision ARG, -r --verbose, -v display more information

Turn this branch into a mirror of another branch.

This command only works on branches that have not diverged. Branches are considered diverged if the destination branch's most recent commit is one that has not been merged (directly or indirectly) into the parent.

If branches have diverged, you can use 'bzr merge' to integrate the changes from one into the other. Once one branch has merged, the other should be able to pull it again.

If branches have diverged, you can use 'bzr merge' to pull the text changes from one into the other. Once one branch has merged, the other should be able to pull it again.

If you want to forget your local changes and just update your branch to match the remote one, use pull --overwrite.

If there is no default location set, the first pull will set it. After that, you can omit the location to use the default. To change the default, use --remember.

bzr push [LOCATION]

Options: --create-prefix Create the path leading up to the branch if it does not already exist --help, -h show help message --overwrite Ignore differences between branches and overwrite unconditionally --remember Remember the specified location as a default.

Update a mirror of this branch.

The target branch will not have its working tree populated because this is both expensive, and is not supported on remote file systems.

Some smart servers or protocols *may* put the working tree in place in the future.

This command only works on branches that have not diverged. Branches are considered diverged if the destination branch's most recent commit is one that has not been merged (directly or indirectly) by the source branch.

If branches have diverged, you can use 'bzr push --overwrite' to replace the other branch completely, discarding its unmerged changes.

If you want to ensure you have the different changes in the other branch, do a merge (see bzr help merge) from the other branch, and commit that. After that you will be able to do a push without '--overwrite'.

If there is no default push location set, the first push will set it. After that, you can omit the location to use the default. To change the default, use --remember.

bzr reconcile [BRANCH]

Options: --help, -h show help message

Reconcile bzr metadata in a branch.

This can correct data mismatches that may have been caused by previous ghost operations or bzr upgrades. You should only need to run this command if 'bzr check' or a bzr developer advises you to run it.

If a second branch is provided, cross-branch reconciliation is also attempted, which will check that data like the tree root id which was not present in very early bzr versions is represented correctly in both branches.

At the same time it is run it may recompress data resulting in a potential saving in disk space or performance gain.

The branch *MUST* be on a listable system such as local disk or sftp.

bzr remerge [FILE...]

Options: --help, -h show help message --merge-type ARG --reprocess Reprocess to reduce spurious conflicts --show-base Show base revision text in conflicts

Redo a merge.

bzr remove FILE...

Options: --help, -h show help message --verbose, -v display more information

Make a file unversioned.

This makes bzr stop tracking changes to a versioned file. It does not delete the working copy.

bzr renames [DIR]

Options: --help, -h show help message

Show list of renamed files.

bzr resolve [FILE...]

Options: --all Resolve all conflicts in this tree --help, -h show help message

Mark a conflict as resolved.

Merge will do its best to combine the changes in two branches, but there are some kinds of problems only a human can fix. When it encounters those, it will mark a conflict. A conflict means that you need to fix something, before you should commit.

Once you have fixed a problem, use "bzr resolve FILE.." to mark individual files as fixed, or "bzr resolve --all" to mark all conflicts as resolved.

See also bzr conflicts.

bzr revert [FILE...]

Options: --help, -h show help message --no-backup --revision ARG, -r

Reverse all changes since the last commit.

Only versioned files are affected. Specify filenames to revert only those files. By default, any files that are changed will be backed up first. Backup files have a '~' appended to their name.

bzr revno [LOCATION]

Options: --help, -h show help message

Show current revision number.

This is equal to the number of revisions on this branch.

bzr root [FILENAME]

Options: --help, -h show help message

Show the tree root directory.

The root is the nearest enclosing directory with a .bzr control directory.

bzr sign-my-commits [LOCATION] [COMMITTER]

Options: --dry-run Don't actually sign anything, just print the revisions that would be signed --help, -h show help message

Sign all commits by a given committer.

If location is not specified the local tree is used. If committer is not specified the default committer is used.

This does not sign commits that already have signatures.

bzr status [FILE...]

Options: --all --help, -h show help message --revision ARG, -r --show-ids show internal object ids

Display status summary.

This reports on versioned and unknown files, reporting them grouped by state. Possible states are:

added Versioned in the working copy but not in the previous revision.

removed Versioned in the previous revision but removed or deleted in the working copy.

renamed Path of this file changed from the previous revision; the text may also have changed. This includes files whose parent directory was renamed.

modified Text has changed since the previous revision.

unchanged Nothing about this file has changed since the previous revision. Only shown with --all.

unknown Not versioned and not matching an ignore pattern.

To see ignored files use 'bzr ignored'. For details in the changes to file texts, use 'bzr diff'.

If no arguments are specified, the status of the entire working directory is shown. Otherwise, only the status of the specified files or directories is reported. If a directory is given, status is reported for everything inside that directory.

If a revision argument is given, the status is calculated against that revision, or between two revisions if two are provided.

bzr testament [BRANCH]

Options: --help, -h show help message --long, -l Use detailed log format. Same as --log- format long --revision ARG, -r

Show testament (signing-form) of a revision.

bzr unbind

Options: --help, -h show help message

Unbind the current branch from its master branch.

After unbinding, the local branch is considered independent. All subsequent commits will be local.

bzr uncommit [LOCATION]

Options: --dry-run Don't actually make changes --force Say yes to all questions. --help, -h show help message --revision ARG, -r --verbose, -v display more information

Remove the last committed revision.

By supplying the --all flag, it will not only remove the entry from revision_history, but also remove all of the entries in the stores.

--verbose will print out what is being removed. --dry-run will go through all the motions, but not actually remove anything.

In the future, uncommit will create a changeset, which can then be re-applied.

bzr unknowns

Options: --help, -h show help message

List unknown files.

bzr update [DIR]

Options: --help, -h show help message

Update a tree to have the latest code committed to its branch.

This will perform a merge into the working tree, and may generate conflicts. If you have any local changes, you will still need to commit them after the update for the update to be complete.

If you want to discard your local changes, you can just do a 'bzr revert' instead of 'bzr commit' after the update.

bzr upgrade [URL]

Options: --format ARG Upgrade to a specific format. Current formats are: default, knit, metaweave and weave. Default is knit; metaweave and weave are deprecated --help, -h show help message

Upgrade branch storage to current format.

The check command or bzr developers may sometimes advise you to run this command. When the default format has changed you may also be warned during other operations to upgrade.

bzr version

Options: --help, -h show help message

Show version of bzr.

bzr whoami

Options: --email --help, -h show help message

Show bzr user id.

ENVIRONMENT

BZRPATH
Path where bzr is to look for external command.
BZREMAIL
E-Mail address of the user. Overrides default user config.
EMAIL
E-Mail address of the user. Overriddes default user config.

FILES

~/.bazaar/bazaar.conf
Contains the default user config. Only one section, [DEFAULT] is allowed. A typical default config file may be similiar to:



[DEFAULT]

email=John Doe <jdoe@isp.com>

SEE ALSO

http://www.bazaar-vcs.org/