Forrest logo
back to the hg tool

hg-branch:tldr:82194

hg-branch: Show the name of the currently active branch.
$ hg branch
try on your machine

The "hg branch" command is used in Mercurial, a distributed version control system, to show or set the current branch in the repository.

When used without any arguments, "hg branch" will display the currently active branch in the repository. It will show the name of the branch that the current working directory is associated with.

Alternatively, you can also pass an argument to "hg branch" to set the active branch. For example, "hg branch mybranch" will set the branch to "mybranch" in the repository. This means that any subsequent commits will be made to this branch.

It is important to note that branching in Mercurial is lightweight and allows users to have multiple independent lines of development within a single repository. The "hg branch" command is a way to manage and switch between these branches.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hg tool