Documentation ¶
Index ¶
- func CheckoutBranch(wd, branch string) error
- func Commit(wd string, messages string) error
- func Config(wd, key, val string) error
- func ConfigGlobal(wd, key, val string) error
- func DoesBranchExistRemotely(wd, uri, branch string) bool
- func GetCurrentTag(wd string) string
- func HasSemverTag(wd, commit string) bool
- func IsCommit(wd, commit string) bool
- func LastLog(wd string) string
- func Log(wd, refId string) string
- func PrintStatus(wd string)
- func Push(wd, origin, branch string) error
- func RemoteGetUrl(wd, name string, flags ...string) (string, error)
- func RemoteOriginAdd(wd, name, uri string) error
- func RemoteOriginRemove(wd, name string) error
- func RemoteSetUrl(wd, name, newUrl, oldUrl string, flags ...string) error
- func RunCommandInteractive(wd, program string, args []string) (io.ReadCloser, io.ReadCloser, io.WriteCloser, error)
- func StageFiles(wd string, files ...string) error
- func StatusWithOptions(wd string, options []string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutBranch ¶
CheckoutBranch check out a branch, making it if it does not exist. git checkout -b <branch_name>
func Commit ¶
Commit Commits any current staged changes. git commit -m "${mergeBranchCommitMsg}" -m "automated update of ${PARAM_CHANGELOG_FILE}"
func ConfigGlobal ¶
ConfigGlobal Set or return a config global value. git config --global <key> <value>
func DoesBranchExistRemotely ¶
DoesBranchExistRemotely return the result of: git ls-remote --heads <repository_url> <branch_name>
func GetCurrentTag ¶
func HasSemverTag ¶
HasSemverTag Indicates when a commit is tagged.
Uses git describe to finds the most recent tag that is reachable from a commit. Only shows annotated tags.
func PrintStatus ¶
func PrintStatus(wd string)
PrintStatus Outputs the git status of the specified directory.
func RemoteGetUrl ¶
RemoteGetUrl runs `git remote get-url --push origin <name>`
func RemoteOriginAdd ¶
RemoteOriginAdd runs `git remote add <origin> <uri>`
func RemoteOriginRemove ¶
RemoteOriginRemove Will run the command: `git remote remove <origin>`
func RemoteSetUrl ¶
RemoteSetUrl runs `git remote set-url [--push] <name> <newurl> [oldUrl]`
func RunCommandInteractive ¶
func RunCommandInteractive( wd, program string, args []string, ) (io.ReadCloser, io.ReadCloser, io.WriteCloser, error)
RunCommandInteractive run an external program via CLI interactively, in a sub process; passing environment variables along.
It will pass in the os.Environ(), overwriting key=value pairs from env map, comparison for the key (variable name) is case-sensitive.
func StageFiles ¶
StageFiles git add CHANGELOG.md "${gitChgLogCon}gDir}"
Types ¶
This section is empty.