LinuxCommandLibrary

hg-branch

manages named branches in Mercurial

TLDR

Show current branch

$ hg branch
copy
Create a new branch
$ hg branch [branch-name]
copy
List all branches
$ hg branches
copy
Switch to a branch
$ hg update [branch-name]
copy
Close current branch
$ hg commit --close-branch -m "[message]"
copy

SYNOPSIS

hg branch [name]

DESCRIPTION

hg branch manages named branches in Mercurial. Without arguments, it shows the current branch name. With a name argument, it marks the working directory as being on a new branch, which takes effect on the next commit. Named branches are permanent parts of changeset history. For lightweight Git-style branches, use hg bookmark instead.

PARAMETERS

-f, --force

Set branch name even if shadowing an existing branch.
-C, --clean
Reset branch name to parent branch name.

SEE ALSO

hg(1), hg-update(1), hg-bookmark(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community