cc branch
Update the branch associated with an environment. Prompts you to choose from local and remote branches of the project's git repository, and saves the selection along with the GitHub URL.
Usage
cc branch [PROJECT] [flags]If no project is specified, uses the currently active project.
Flags
| Flag | Description |
|---|---|
-c, --checkout | Also checkout the branch in the working directory after updating the record |
Examples
cc branch
# → Prompts to select environment and branch for the active project
cc branch acme
# → Prompts to select environment and branch for the acme project
cc branch -c
# → Updates the branch record AND checks out the branch in git
cc branch acme -c
# → Same as above, for the acme projectAfter selection, CC saves the branch name and GitHub URL to the environment record. Without -c, only the record is updated. With -c, the branch is also checked out in the project's working directory.
The branch is always checked out automatically on cc switch, regardless of whether -c was used.
Related
cc switch— checks out the configured branch on switchcc env— manage environments