Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentBranch ¶
GetCurrentBranch returns the current git branch name for the given directory. If it fails to get the branch name, it returns an empty string.
func GetDefaultBranch ¶ added in v0.0.12
GetDefaultBranch returns the default branch name for the remote "origin". It falls back to "main" if the default branch cannot be determined.
func GetRemoteURL ¶
GetRemoteURL returns the git remote URL for the given directory. It defaults to the "origin" remote. If it fails to get the URL, it returns an empty string.
func GetRepoRoot ¶
GetRepoRoot returns the absolute path to the git repository root for the given path. The input can be either a file or a directory within the repository. If the path is not inside a git repository or an error occurs, it returns an empty string.
Types ¶
This section is empty.