Versions in this module Expand all Collapse all v1 v1.0.0 Dec 12, 2025 Changes in this version + const MergeBaseConfig + var AllMatchingCredentialsPattern = CredentialPattern + var ErrNotOnAnyBranch = errors.New("git: not on any branch") + func IsURL(u string) bool + func ParseURL(rawURL string) (*url.URL, error) + type BranchConfig struct + MergeBase string + MergeRef string + PushRemoteName string + PushRemoteURL *url.URL + RemoteName string + RemoteURL *url.URL + type Client struct + GhPath string + GitPath string + RepoDir string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func (c *Client) AddRemote(ctx context.Context, name, urlStr string, trackingBranches []string) (*Remote, error) + func (c *Client) AuthenticatedCommand(ctx context.Context, credentialPattern CredentialPattern, args ...string) (*Command, error) + func (c *Client) CheckoutBranch(ctx context.Context, branch string) error + func (c *Client) CheckoutNewBranch(ctx context.Context, remoteName, branch string) error + func (c *Client) Clone(ctx context.Context, cloneURL string, args []string, mods ...CommandModifier) (string, error) + func (c *Client) Command(ctx context.Context, args ...string) (*Command, error) + func (c *Client) CommitBody(ctx context.Context, sha string) (string, error) + func (c *Client) Commits(ctx context.Context, baseRef, headRef string) ([]*Commit, error) + func (c *Client) Config(ctx context.Context, name string) (string, error) + func (c *Client) Copy() *Client + func (c *Client) CurrentBranch(ctx context.Context) (string, error) + func (c *Client) DeleteLocalBranch(ctx context.Context, branch string) error + func (c *Client) DeleteLocalTag(ctx context.Context, tag string) error + func (c *Client) Fetch(ctx context.Context, remote string, refspec string, mods ...CommandModifier) error + func (c *Client) GitDir(ctx context.Context) (string, error) + func (c *Client) HasLocalBranch(ctx context.Context, branch string) bool + func (c *Client) IsLocalGitRepo(ctx context.Context) (bool, error) + func (c *Client) LastCommit(ctx context.Context) (*Commit, error) + func (c *Client) PathFromRoot(ctx context.Context) string + func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error + func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error + func (c *Client) PushDefault(ctx context.Context) (PushDefault, error) + func (c *Client) PushRevision(ctx context.Context, branch string) (RemoteTrackingRef, error) + func (c *Client) ReadBranchConfig(ctx context.Context, branch string) (BranchConfig, error) + func (c *Client) RemotePushDefault(ctx context.Context) (string, error) + func (c *Client) Remotes(ctx context.Context) (RemoteSet, error) + func (c *Client) SetBranchConfig(ctx context.Context, branch, name, value string) error + func (c *Client) SetRemoteBranches(ctx context.Context, remote string, refspec string) error + func (c *Client) SetRemoteResolution(ctx context.Context, name, resolution string) error + func (c *Client) ShowRefs(ctx context.Context, refs []string) ([]Ref, error) + func (c *Client) ToplevelDir(ctx context.Context) (string, error) + func (c *Client) TrackingBranchNames(ctx context.Context, prefix string) []string + func (c *Client) UncommittedChangeCount(ctx context.Context) (int, error) + func (c *Client) UnsetRemoteResolution(ctx context.Context, name string) error + func (c *Client) UpdateRemoteURL(ctx context.Context, name, url string) error + type Command struct + func (gc *Command) Output() ([]byte, error) + func (gc *Command) Run() error + type CommandModifier func(*Command) + func WithRepoDir(repoDir string) CommandModifier + func WithStderr(stderr io.Writer) CommandModifier + func WithStdin(stdin io.Reader) CommandModifier + func WithStdout(stdout io.Writer) CommandModifier + type Commit struct + Body string + Sha string + Title string + type CredentialPattern struct + func CredentialPatternFromGitURL(gitURL string) (CredentialPattern, error) + func CredentialPatternFromHost(host string) CredentialPattern + type GitError struct + ExitCode int + Stderr string + func (ge *GitError) Error() string + func (ge *GitError) Unwrap() error + type NotInstalled struct + func (e *NotInstalled) Error() string + func (e *NotInstalled) Unwrap() error + type PushDefault string + const PushDefaultCurrent + const PushDefaultMatching + const PushDefaultNothing + const PushDefaultSimple + const PushDefaultTracking + const PushDefaultUpstream + func ParsePushDefault(s string) (PushDefault, error) + type Ref struct + Hash string + Name string + type Remote struct + FetchURL *url.URL + Name string + PushURL *url.URL + Resolved string + func NewRemote(name string, u string) *Remote + func (r *Remote) String() string + type RemoteSet []*Remote + func (r RemoteSet) Len() int + func (r RemoteSet) Less(i, j int) bool + func (r RemoteSet) Swap(i, j int) + type RemoteTrackingRef struct + Branch string + Remote string + func ParseRemoteTrackingRef(s string) (RemoteTrackingRef, error) + func (r RemoteTrackingRef) String() string