Documentation ¶
Index ¶
- func CheckForValidForkRemote(upstreamURL, remoteURL, repo string) bool
- type Git
- func (g *Git) AddAndCommit(message string) error
- func (g *Git) CheckFileExists(file, branch string) error
- func (g *Git) CheckoutBranch(branch string) error
- func (g *Git) CheckoutFile(branch, file string) error
- func (g *Git) CreateAndCheckoutBranch(branch string) error
- func (g *Git) DeleteBranch(branch string) error
- func (g *Git) FetchAndCheckoutBranch(branch string) error
- func (g *Git) FetchBranch(branch string) error
- func (g *Git) IsClean() error
- func (g *Git) PushBranch(remote, branch string) error
- func (g *Git) ResetHEAD() error
- func (g *Git) StatusProcelain() (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForValidForkRemote ¶
CheckForValidForkRemote checks if the remote URL is a valid remote fork for the upstream URL.
Types ¶
type Git ¶
Git struct holds necessary data to work with the current git repository
func CloneAtDir ¶
CloneAtDir clones a repository at a given directory. Equivalent to: git clone <url> <dir> It will return a Git struct with the repository's branch and remotes populated.
func (*Git) AddAndCommit ¶
AddAndCommit stages all changes and commits them with a given message, equivalent to: git add -A && git commit -m message
func (*Git) CheckFileExists ¶ added in v0.9.6
CheckFileExists checks if a file exists in the git repository for a specific branch
func (*Git) CheckoutBranch ¶
CheckoutBranch checks out a branch
func (*Git) CheckoutFile ¶ added in v0.9.6
CheckoutFile checks out a file in a branch ex: git checkout <remote>/<branch> -- <file>
func (*Git) CreateAndCheckoutBranch ¶
CreateAndCheckoutBranch creates and checks out to a given branch. Equivalent to: git checkout -b <branch>
func (*Git) DeleteBranch ¶
DeleteBranch deletes the given branch
func (*Git) FetchAndCheckoutBranch ¶
FetchAndCheckoutBranch fetches and checks out a branch
func (*Git) FetchBranch ¶
FetchBranch fetches a branch
func (*Git) IsClean ¶
IsClean checks if the git repository is clean and, returns nil if it is clean, throws an error otherwise
func (*Git) PushBranch ¶
PushBranch pushes the current branch to a given remote name
func (*Git) ResetHEAD ¶ added in v0.9.6
ResetHEAD resets the HEAD of the git repository ex: git reset HEAD
func (*Git) StatusProcelain ¶
StatusProcelain checks if the git repository is clean and, returns true if it is clean, false otherwise