SYNOPSIS

List or create branches.

To create a branch, "ngt branch BRANCH_NAME"

To list branches, "ngt branch". Note the output of "ngt status" with optional "-a" and "-d" flags will also display the currently checked out branches along with additional details.

To list all branches, "ngt branch -a"

To delete a branch, "ngt branch -d BRANCH_NAME". See below for additional options.

NOTE: The "-r" syntax for deleting remote repositories in Nuggit differs from native git. In git this command requires specifying a branch in the form 'origin/branch' and only removes them locally. Nuggit does not require the prefix, and removes them locally and remotely.

--help

Display an abbreviated help menu

--man

Display detailed documentation.

-d | --delete

Delete specified branch from the root repository, and all submodules, providing that said branch has been merged.

Equivalent to "git branch -d", deleting the specified branch name only if it has been merged into HEAD. This version will apply said change to all submodules.

-D | --delete-force

This flag forces deletion of the branch regardless of merged state. Usage is otherwise the same as -d above and mirrors "git branch -D"

-r | remote

Apply operation to the remote (server) branch.

This flag currently applies only branch deletion operations, and is explicitly documented below as '-rd' and '-rD'.

Typical usage is: "ngt branch -rd branch" or "ngt branch -rD branch".

Note: Unlike the native git branch command, no 'origin' prefix is required here.

-rd

This will delete the specified branch from the remote origin for the root repository, and all submodules, providing that said branch has been merged into HEAD [as known to local system]. Precede this commmand with a "ngt fetch" to ensure local knowledge is up to date with the current state of the origin to improve accuracy of this check.

This check is meant to supplement server-side hooks/settings to help minimize user errors, but does not replace the utility of additional server-side checks.

-rD

Delete specified branch from the remote origin for the root repository, and all submodules, unconditionally.

--all | -a

List all known branches, not just those that exist locally. Remote branches are typically prefixed with "remotes/origin/". This is equivalent to the same option to "git branch".

--merged | --no-merged

Filter branch listing by merged or not merged state. If neither option is specified, then all matching branches will be displayed. This may be combined with the "-a" option, and is equivalent to the same option in "git branch".

NOTE: If the '--no-merged' option is specified, checks for submodule branches matching root will be skipped.

--recursive

Recurse through all the submodules. When used with no other options, or --merged, or --no-merged, or --all, this will display matching branches across all repositories/submodules

--orphans

List all orphaned branches. An orphaned branch is one that exists in a submodule but not in the root repository. This will also accept the following flags: --json, --all.

--orphan

This argument must specify a branch name and an additional flag. If no other flags are provided indicating specific information about the orphan, this will show full details about the orphan branch. Full details include, the count of repos where the specified branch exists, count of repos where specified branch is missing, gives a list of repos where specified branch is missing, gives a list of repos where specified branch exists. When this flag is provided, the following specifics can be requested --missing-from or --exists-in, where information about which repos do not have this branch, or which repos do have this branch respectively.

--exists-in-all

The --exists-in-all flag may be provided an optional branch name. If a branch name is provided, this will check if the specified branch exists in all submodules. If no branch name is provided, this will output a list of branches that do exist in all submodules that are visibile from the currently checked out workspace/branch.