Documentation ¶
Overview ¶
Package git contains routines for interacting with git over the CLI. Unlike go-git, this is not a pure go library for interacting with git, and relies on the git command line being available locally. This is meant to provide high level interfaces used throughout various Gruntwork CLIs.
NOTE: The tests for these packages are intentionally stored in a separate test folder, rather than the go converntional style of source_test.go files. This is done to ensure that the tests for the packages are run in a separate docker container, as many functions in this package pollute the global git configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
Clone runs git clone to clone the specified repository into the given target directory.
func ConfigureForceHTTPS ¶
func ConfigureForceHTTPS() error
ConfigureForceHTTPS configures git to force usage of https endpoints instead of SSH based endpoints for the three primary VCS platforms (GitHub, GitLab, BitBucket).
func ConfigureHTTPSAuth ¶
ConfigureHTTPSAuth configures git with username and password to authenticate with the given VCS host when interacting with git over HTTPS. This uses the cache credentials store to configure the credentials. Refer to the git documentation on credentials storage for more information: https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
Types ¶
type TargetDirectoryNotExistsErr ¶
type TargetDirectoryNotExistsErr struct {
// contains filtered or unexported fields
}
TargetDirectoryNotExistsErr is returned when the target directory of the git commands does not exist or is not a directory.
func (TargetDirectoryNotExistsErr) Error ¶
func (err TargetDirectoryNotExistsErr) Error() string