Documentation
¶
Overview ¶
Package git wraps internal/run.Runner to provide git-specific operations.
Index ¶
- type Git
- func (g *Git) Checkout(branch string) error
- func (g *Git) Clone(url, dir string) error
- func (g *Git) CommitsAhead(base string) (int, error)
- func (g *Git) CurrentBranch() (string, error)
- func (g *Git) Fetch(remote, branch string) error
- func (g *Git) GetConfig(key string) (string, error)
- func (g *Git) HasUncommittedChanges() (bool, error)
- func (g *Git) RemoteURL(name string) (string, error)
- func (g *Git) SetConfig(key, value string) error
- func (g *Git) SetConfigInDir(dir, key, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git provides git operations via the Runner.
func (*Git) CurrentBranch ¶
func (*Git) GetConfig ¶ added in v1.8.0
GetConfig reads a value from the local repository's git config. A missing key returns ("", nil) — git config exits non-zero in that case but callers should treat absence as "fall back to other inference" rather than as an error condition.
func (*Git) HasUncommittedChanges ¶
func (*Git) SetConfig ¶ added in v1.8.0
SetConfig writes a key-value pair to the local repository's git config. Used by `repo set-default` to pin a chosen Bitbucket coordinate so future commands in this checkout do not consult the git remote.
func (*Git) SetConfigInDir ¶ added in v1.116.0
SetConfigInDir writes a key-value pair to the git config of a specific repo dir.