Version: v1.3.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 2 Imported by: 2



Package branch git-branch - List, create, or delete branches.



git branch [--color[=<when>] | --no-color] [-r | -a]
	[--list] [-v [--abbrev=<length> | --no-abbrev]]
	[--column[=<options>] | --no-column] [--sort=<key>]
	[(--merged | --no-merged) [<commit>]]
	[--contains [<commit]] [--no-contains [<commit>]]
	[--points-at <object>] [--format=<format>] [<pattern>…​]
git branch [--track | --no-track] [-l] [-f] <branchname> [<start-point>]
git branch (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
git branch --unset-upstream [<branchname>]
git branch (-m | -M) [<oldbranch>] <newbranch>
git branch (-c | -C) [<oldbranch>] <newbranch>
git branch (-d | -D) [-r] <branchname>…​
git branch --edit-description [<branchname>]



This section is empty.


This section is empty.


func Abbrev

func Abbrev(n string) func(*types.Cmd)

Abbrev use <n> digits to display SHA-1s --abbrev[=<n>]

func All

func All(g *types.Cmd)

All list both remote-tracking and local branches -a, --all

func BranchName

func BranchName(name string) func(*types.Cmd)

BranchName branch name

func Color

func Color(when string) func(*types.Cmd)

Color use colored output --color[=<when>]

func Column

func Column(style string) func(*types.Cmd)

Column list branches in columns --column[=<style>]

func Contains

func Contains(commit string) func(*types.Cmd)

Contains print only branches that contain the commit --contains <commit>

func CreateReflog

func CreateReflog(g *types.Cmd)

CreateReflog create the branch's reflog -l, --create-reflog

func Delete

func Delete(g *types.Cmd)

Delete delete fully merged branch -d, --delete

func DeleteForce

func DeleteForce(g *types.Cmd)

DeleteForce delete branch (even if not merged) -D

func EditDescription

func EditDescription(g *types.Cmd)

EditDescription edit the description for the branch --edit-description

func Force

func Force(g *types.Cmd)

Force force creation, move/rename, deletion -f, --force

func Format

func Format(format string) func(*types.Cmd)

Format format to use for the output --format <format>

func IgnoreCase

func IgnoreCase(g *types.Cmd)

IgnoreCase sorting and filtering are case insensitive -i, --ignore-case

func List

func List(g *types.Cmd)

List list branch names --list

func Merged

func Merged(commit string) func(*types.Cmd)

Merged print only branches that are merged --merged <commit>

func Move

func Move(g *types.Cmd)

Move move/rename a branch and its reflog -m, --move

func MoveForce

func MoveForce(g *types.Cmd)

MoveForce move/rename a branch, even if target exists -M

func NoContains

func NoContains(commit string) func(*types.Cmd)

NoContains print only branches that don't contain the commit --no-contains <commit>

func NoMerged

func NoMerged(commit string) func(*types.Cmd)

NoMerged print only branches that are not merged --no-merged <commit>

func PointsAt

func PointsAt(object string) func(*types.Cmd)

PointsAt print only branches of the object --points-at <object>

func Quiet

func Quiet(g *types.Cmd)

Quiet suppress informational messages -q, --quiet

func Remotes

func Remotes(g *types.Cmd)

Remotes act on remote-tracking branches -r, --remotes

func SetUpstream

func SetUpstream(g *types.Cmd)

SetUpstream change upstream info --set-upstream

func SetUpstreamTo

func SetUpstreamTo(upstream string) func(*types.Cmd)

SetUpstreamTo change the upstream info -u, --set-upstream-to <upstream>

func Sort

func Sort(key string) func(*types.Cmd)

Sort field name to sort on --sort <key>

func Track

func Track(g *types.Cmd)

Track set up tracking mode (see git-pull(1)) -t, --track

func UnsetUpstream

func UnsetUpstream(g *types.Cmd)

UnsetUpstream change the upstream info -u, --set-upstream-to <upstream>

func Verbose

func Verbose(g *types.Cmd)

Verbose show hash and subject, give twice for upstream branch -v, --verbose


This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL