Create branches

To create a new branch, use the branch command with one or two arguments. You might create branches to work on a new feature in one of your own projects, or to contribute to a project that you've cloned. Branches have a parent-child relationship, so the new branch will be a child of the current branch.

Branch arguments are optionally preceded by a slash to disambiguate them from other codebase entities. This creates a copy of the main branch in aNewBranch and switches to it.

myProject/main> branch /aNewBranch

You might also see branch arguments prefixed by the contributor's Unison Share handle.

myProject/main> branch /@contributor/aNewBranch

You cannot otherwise have multiple slashes in a branch name.

myProject/main> branch /myNewBranch
@unison/base/main> branch /myNewFeature

It is also possible to create a branch with two arguments. The first is the source, or parent branch, and the second is the new branch being created.

myProject/main> branch /srcBranch /destBranch