cli.sgit.ai / Command reference / sgit branch

sgit branch

Branch management.

Generated from sgit help all --format json, sgit-ai v0.23.0. 7 subcommands below. To change this page, change the command's register() in the CLI and regenerate.

sgit branch

Subcommands

sgit branch checkout

Switch to a branch or restore a specific commit

sgit branch checkout [options] [target] [directory]
ArgumentWhat it is
targetoptionalBranch name, branch ID, or commit ID to switch to
directoryoptionalVault directory (default: .)
OptionWhat it does
--forceForce checkout even if there are uncommitted changes (discards them)
--vault-keyVault key (required for bare vaults without a saved key)

sgit branch list

List all named branches

sgit branch list [directory]
ArgumentWhat it is
directoryoptionalVault directory (default: .)

sgit branch merge

Merge another named branch into the current one

sgit branch merge [options] <name> [directory]
ArgumentWhat it is
namerequiredThe branch to merge in (name or ID), e.g. feature or current
directoryoptionalVault directory (default: .)
OptionWhat it does
--base-urlAPI base URL
--tokenSG/Send access token

sgit branch merge-abort

Abort an in-progress merge

sgit branch merge-abort [directory]
ArgumentWhat it is
directoryoptionalVault directory (default: .)

sgit branch new

Create a new named branch and switch to it

sgit branch new [options] <name> [directory]
ArgumentWhat it is
namerequiredNew branch name
directoryoptionalVault directory (default: .)
OptionWhat it does
--fromBranch from a specific named branch (name or ID)

sgit branch rename

Rename a branch this clone created and has not pushed

sgit branch rename [options] <old> <new> [directory]
ArgumentWhat it is
oldrequiredCurrent branch name
newrequiredNew branch name
directoryoptionalVault directory (default: .)
OptionWhat it does
--base-urlAPI base URL
--tokenSG/Send access token

sgit branch switch

Switch to a named branch

sgit branch switch [options] <name_or_id> [directory]
ArgumentWhat it is
name_or_idrequiredNamed branch name or branch ID
directoryoptionalVault directory (default: .)
OptionWhat it does
--base-urlAPI base URL
--forceForce switch even if there are uncommitted changes (discards them)
--tokenSG/Send access token (to fetch the branch from the server)

This page as markdown · its source, admin/content/reference/sgit-cli-reference.json