Create a new branch that is a copy of an existing branch.




Bind new branch to from location.

-b ARG, --colocated-branch=ARG

Name of colocated branch to sprout.


Get file contents from this tree.


Hard-link working tree files where possible.

-h, --help

Show help message.


Do not recursively check out nested trees.


Create a branch without a working-tree.

-q, --quiet

Only display errors and warnings.

-r ARG, --revision=ARG

See “help revisionspec” for details.


Create a stacked branch referring to the source branch. The new branch will depend on the availability of the source branch for all operations.


Do not use a shared repository, even if available.


Switch the checkout in the current directory to the new branch.


Show usage message and options.


By default branch will fail if the target directory exists, but does not already have a control directory. This flag will allow branch to proceed.

-v, --verbose

Display more information.


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. If the FROM_LOCATION has no / or path separator embedded, the TO_LOCATION is derived from the FROM_LOCATION by stripping a leading scheme or drive identifier, if any. For example, “branch lp:foo-bar” will attempt to create ./foo-bar.

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

See also