Documentation
¶
Overview ¶
Package git provides functions for interacting with git repositories by shelling out to the git CLI.
Index ¶
- func CommitDate(repoPath, branch string) (time.Time, error)
- func CurrentBranch(repoPath string) (string, error)
- func DefaultBranch(repoPath string) (string, error)
- func DeleteLocalBranch(repoPath, branch string, force bool) error
- func DeleteRemoteBranch(repoPath, remote, branch string) error
- func Fetch(repoPath, remote string) error
- func HasRemote(repoPath, remote string) bool
- func IsClean(repoPath string) (bool, error)
- func IsMerged(repoPath, branch, base string) (bool, error)
- func IsRepo(path string) bool
- func ListBranches(repoPath string) ([]string, error)
- func MergedBranches(repoPath, base string) ([]string, error)
- func RemoteURL(repoPath, remote string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitDate ¶
CommitDate returns the author date of the latest commit on the given branch.
func CurrentBranch ¶
CurrentBranch returns the name of the currently checked-out branch.
func DefaultBranch ¶
DefaultBranch returns the default branch name (main or master) by checking what the origin HEAD points to, falling back to a local heuristic.
func DeleteLocalBranch ¶
DeleteLocalBranch deletes a local branch. If force is true, uses -D instead of -d.
func DeleteRemoteBranch ¶
DeleteRemoteBranch deletes a branch on the given remote.
func ListBranches ¶
ListBranches returns all local branch names.
func MergedBranches ¶
MergedBranches returns local branches that have been merged into the given base branch.
Types ¶
This section is empty.