Documentation
¶
Index ¶
- type Git
- func (g *Git) AbortMerge() error
- func (g *Git) AbortRebase() error
- func (g *Git) BehindCount(remote, branch string) (int, error)
- func (g *Git) Checkout(branch string) error
- func (g *Git) ConfigureIdentity(name, email string) error
- func (g *Git) CreateBranch(name, from string) error
- func (g *Git) CurrentBranch() (string, error)
- func (g *Git) DefaultBranch() (string, error)
- func (g *Git) Diff(base, head string) (string, error)
- func (g *Git) DiffStat(base, head string) (string, error)
- func (g *Git) Fetch(remote string) error
- func (g *Git) ForcePush(remote, branch string) error
- func (g *Git) HasConflicts() bool
- func (g *Git) HeadSHA() (string, error)
- func (g *Git) IsDirty() (bool, error)
- func (g *Git) IsMerging() bool
- func (g *Git) Merge(branch string) error
- func (g *Git) Pull(remote, branch string) error
- func (g *Git) Push(remote, branch string) error
- func (g *Git) Rebase(onto string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Git ¶
type Git struct {
WorkDir string
}
Git wraps the git CLI for repository operations.
func (*Git) AbortRebase ¶
AbortRebase aborts an in-progress rebase.
func (*Git) BehindCount ¶ added in v0.2.3
BehindCount returns the number of commits HEAD is behind remote/branch. Caller must fetch before calling this.
func (*Git) ConfigureIdentity ¶
ConfigureIdentity sets the local git user identity for commits/merges if not already set.
func (*Git) CreateBranch ¶
func (*Git) CurrentBranch ¶
func (*Git) DefaultBranch ¶ added in v0.2.3
DefaultBranch returns the default branch name by inspecting origin/HEAD. Falls back to "main" if origin/HEAD is not set.
func (*Git) DiffStat ¶ added in v0.2.0
DiffStat returns the --stat output for changes introduced by head since its merge base with base (three-dot diff), matching the semantics of Diff.
func (*Git) HasConflicts ¶
func (*Git) IsDirty ¶ added in v0.2.3
IsDirty returns true if the working tree has uncommitted changes (staged or unstaged, including untracked files).