Documentation
¶
Index ¶
- func Add(paths ...string) error
- func Amend() error
- func AmendNoEdit() error
- func AmendWithMessage(message string) error
- func AppendNotes(object, note string) error
- func ApplyPatch(r io.Reader) error
- func BranchExists(name string) bool
- func Checkout(ref string) error
- func Commit(message string) error
- func CreateAndSwitchToBranch(branchName string) error
- func CreateBranch(branchName string) error
- func CreateBranchForced(branchName, ref string) error
- func Diff(ref1, ref2 string) (buf *bytes.Buffer, err error)
- func ForceAddNotes(object, note string) error
- func ForceDeleteBranch(branchName string) error
- func ForcePushBranch(branch string) error
- func FormatShowRefDescription(ref, format string) (s string, err error)
- func GetCurrentBranchName() (name string, err error)
- func GetForkPoint(ref string, arg ...string) (string, error)
- func GetPushRemoteForBranch(branch string) (string, error)
- func Git(arg ...string) error
- func GitOutput(arg ...string) (string, error)
- func HasChanges() (bool, error)
- func IsAncestor(ref1, ref2 string) (bool, error)
- func IsDifferent(ref1, ref2 string) (bool, error)
- func Log(arg ...string) (string, error)
- func Push() error
- func PushAndSetUpstream(remote, branch string) error
- func PushBranch(branch string) error
- func Rebase(base, topic string) error
- func RevParse(ref string) (string, error)
- func ShowNotes(object string) (string, error)
- type Cmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Amend ¶
func Amend() error
Amend runs `git commit --amend` to amend the details of the last commit. It binds to the terminal so that in-terminal editors like vim can be used "normally"
func AmendNoEdit ¶
func AmendNoEdit() error
Amend runs `git commit --amend --no-edit` to amend the details of the last commit
func AmendWithMessage ¶
AmendWithMessage runs `git commit --amend -m <message>`
func AppendNotes ¶
AppendNote appends the supplied note to any existing notes associated with the specified object.
func ApplyPatch ¶
ApplyPatch applies the patch in buf to the working tree but doesn't add or commit it.
func BranchExists ¶
BranchExists returns whether or not the specified branch name exists
func CreateAndSwitchToBranch ¶
CreateAndSwitchToBranch creates a new branch and switches to it (`git checkout -b`)
func CreateBranch ¶
CreateBranch creates a branch at HEAD but doesn't switch to it
func CreateBranchForced ¶
CreateBranchForced creates a branch at ref but doesn't switch to it.
func Diff ¶
Diff shows the diff/patch between two specific commits. If it succeeds, buf contains the patch and err is nil. If it fails, buf contains the error output and err contains the error returned from Run()
func ForceAddNotes ¶
ForceAddNote replaces the note associated with the specified object.
func ForceDeleteBranch ¶
ForceDeleteBranch force-deletes the specified branch
func ForcePushBranch ¶
ForcePushBranch pushes a branch to its default remote without switching to it.
func FormatShowRefDescription ¶
ShowRefDescription gets the description for the specified commit ref. If it succeeds, s contains the description and err is nil. If it fails, s contains the error output and err contains the error returned from Run().
func GetCurrentBranchName ¶
GetCurrentBranchName gets the current branch name
func GetForkPoint ¶
GetForkPoint returns the common ancestor commit of the specified refs
func GetPushRemoteForBranch ¶
GetPushRemoteForBranch gets the name for the default push remote for the specified branch
func HasChanges ¶
HasChanges returns true if there are changes that have not been committed in the working tree
func IsAncestor ¶
IsAncestor returns if the first ref is an ancestor of the second
func IsDifferent ¶
func PushAndSetUpstream ¶
PushAndSetUpstream sets the remote tracking branch and pushes
func PushBranch ¶
PushBranch pushes a branch to its default remote without switching to it.