Documentation ¶
Index ¶
- func CommentChar() string
- func CurrentBranch() (string, error)
- func Dir() (string, error)
- func Edit(filePrefix, message string) (string, string, error)
- func EditFile(filePrefix, message string) (string, error)
- func Fetch(remote, commit string) error
- func GetLocalRemotes() (string, error)
- func GetLocalRemotesFromFile() (string, error)
- func InsideGitRepo() bool
- func IsRemote(remote string) (bool, error)
- func LastCommitMessage(sha string) (string, error)
- func Log(sha1, sha2 string) (string, error)
- func New(args ...string) *exec.Cmd
- func NumberCommits(sha1, sha2 string) int
- func PagerCommand() (string, []string)
- func PathWithNamespace(remote string) (string, error)
- func RemoteAdd(name, url, dir string) error
- func RemoteBranches(remote string) ([]string, error)
- func Remotes() ([]string, error)
- func RepoName() (string, error)
- func Show(commit1, commit2 string, reverse bool)
- func UpstreamBranch(branch string) (string, error)
- func WorkingDir() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommentChar ¶
func CommentChar() string
CommentChar returns active comment char and defaults to '#'
func CurrentBranch ¶
CurrentBranch returns the currently checked out branch
func EditFile ¶ added in v0.22.1
EditFile opens a file in the users editor and returns the contents. It stores a temporary file in your .git directory or /tmp if accessed outside of a git repo.
func GetLocalRemotes ¶ added in v0.22.1
GetLocalRemotes returns a string of local remote names and URLs
func GetLocalRemotesFromFile ¶ added in v0.22.1
GetLocalRemotesFromFile returns a string of local remote names and URLs based on their placement within .git/config file, which holds a different ordering compared to the alternatives presented by Remotes() and GetLocalRemotes().
func InsideGitRepo ¶ added in v0.9.1
func InsideGitRepo() bool
InsideGitRepo returns true when the current working directory is inside the working tree of a git repo
func LastCommitMessage ¶
LastCommitMessage returns the last commits message as one line
func NumberCommits ¶ added in v0.22.1
NumberCommits returns the number of commits between two commit refs
func PagerCommand ¶ added in v0.22.1
PagerCommand returns the commandline and environment for the pager
func PathWithNamespace ¶ added in v0.22.1
PathWithNamespace returns the owner/repository for the current repo Such as zaquestion/lab Respects GitLab subgroups (https://docs.gitlab.com/ce/user/group/subgroups/)
func RemoteBranches ¶ added in v0.22.1
RemoteBranches get the list of branches the specified remote has
func UpstreamBranch ¶ added in v0.22.1
UpstreamBranch returns the upstream of the specified branch
func WorkingDir ¶
WorkingDir returns the full path to the root of the current git repository
Types ¶
This section is empty.