Documentation ¶
Overview ¶
Package git provides helper functions to work with Git repository - and mainly its configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigValue ¶
ConfigValue returns the "best" value for the given configuration key. It respects the "git config" algorithm to search for a value: - first, the local git repository based on the working directory - then the global git config, either in $HOME/.gitconfig or $XDG_CONFIG_HOME/git/config or $HOME/.config/git/config - and finally the system git config, from /etc/gitconfig If not found, it will return an empty string. The key syntax is the same as used in the "git config" cmdline: a dot-separated path of elements. For example: `user.name` or `remote.origin.url`.
func CurrentRepositoryURL ¶
func CurrentRepositoryURL() string
CurrentRepositoryURL returns the URL of the current git repository, based on the "origin" remote URL. If no repository could be found (from the current working directory), or if there is no "origin" remote configured, it will return an empty string.
Types ¶
This section is empty.