ek9_git_branch
Answers first: current, branchCount and branchNames, then per-branch records (name, current, upstream, ahead/behind, gone, sha).
When to use it
'Which branches exist, what am I on?' - one call, no arguments; pattern:'feature/*' filters, includeRemote:true adds remote-tracking branches.
When not to use it
- moving to or creating a branch - use
ek9_git_switch. - the working-tree state of the current branch - use
ek9_git_status. - commit history - use
ek9_git_log.
Details
Headline first: status, summary, current, branchCount and branchNames; then branches[] as {name, current, upstream, ahead, behind, gone, sha} - ahead/behind only with an upstream, gone:true when that upstream no longer exists, sha the 8-hex short form shared with ek9_git_log and ek9_git_blame. verbosity:'summary' keeps the names and drops the records.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
includeRemote | boolean | Also list remote-tracking branches (origin/...). Default false. | |
pattern | string | Glob (* and ?) matched against the short branch name, e.g. 'feature/*'. Default: every branch. |
It also takes the arguments every tool takes.