Reference
mg branch
Shortcut to create and switch to a new branch
Name
mg branch
— Create a new branch on top of the current one and immediately check it out.
Synopsis
Description
-
Creates a new branch on top of the branch you are currently on
-
Automatically moves you to the newly created branch.
Options / Flags
-
-t, --from-trunk <branch_name>
: Checkout the default/main branch and create a new branch on top. -
-D, <branch_name>
: Force delete branch (in mg and in git)
Examples
You can always see what your tree structure looks like with mg list . - See also mg checkout for switching branches.
Was this page helpful?