Documentation
¶
Index ¶
- func AddAll(path string) error
- func AddIndexPath(w git.Worktree, path string) error
- func AddRemote(path string, name string, url string) error
- func CheckIfBranchExists(path string, branchName string) (bool, error)
- func CheckoutBranch(path string, branchName string) error
- func CheckoutCommit(path string, commitHash string) error
- func Clone(repo string, path string, oldCommitSave bool) error
- func CloneWithAuth(repo string, path string, username string, password string, oldCommitSave bool) error
- func CreateBranch(path string, branchName string) error
- func DeleteBranch(path string, branchName string) error
- func EditorGetText(editor string, defaultText string, wd string, fileTitle string) (string, error)
- func GetCommitByHash(path string, hash string) (object.Commit, error)
- func GetConfigEditor() (string, error)
- func GetCurrentBranch(path string) (string, error)
- func GetGitURL(path string) (string, error)
- func GetHeadHash(path string) (string, error)
- func GetUserConfig(path string) (string, string, error)
- func GitAddAll() error
- func GitCheckoutFileHead(file string) error
- func GitCommitAmend(message string) error
- func GitCommitAmendNoEdit() error
- func GitConfigPullRebaseTrueOnlyIfNotSet() error
- func GitDeleteRemoteBranch(remote string, branch string) error
- func GitDiffIndexCommit(commit string) (bool, error)
- func GitDiffIndexHead() (bool, error)
- func GitDiffRef(ref1 string, ref2 string) (bool, error)
- func GitFetchAll() error
- func GitPull(username string, password string, remote string) error
- func GitPullRebase(username string, password string, remote string) error
- func GitRemoteContainsHash(hash string) bool
- func GitRemoveAll() error
- func GitResetAllHead() error
- func GitRevert(commitID string) error
- func GitRmCached() error
- func GitStash() error
- func GitStashPop() error
- func Init(path string) error
- func IsDetachedHead(path string) (bool, error)
- func IsGitInstalled() bool
- func IsPathGitRepo(path string) bool
- func IsWorkTreeClean(path string) (bool, error)
- func ListAllCommits(path string) ([]object.Commit, error)
- func ListBranches(path string) ([]string, error)
- func ListCommit(path string) ([]object.Commit, error)
- func OpenRepo(path string) (*git.Repository, error)
- func Pull(path string, remote string, username string, password string) error
- func Push(path string, remote string, username string, password string) error
- func RemoteExists(path string, name string) (bool, error)
- func RemoveAll(path string) error
- func RemoveRemote(path string, name string) error
- func SetUserConfig(path string, name string, email string) error
- func SoftReset(path string, commit object.Commit) error
- type CommitResult
- type FileStatus
- type Remote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAll ¶
Add all files to the staging area
If git is installed, use git add . to add all files. If not, use go-git
func AddIndexPath ¶
Add a file to the staging area
func CheckoutBranch ¶
func CheckoutCommit ¶
func CloneWithAuth ¶
func CreateBranch ¶
func DeleteBranch ¶
func EditorGetText ¶
Get an input from the user using the specified editor. Similar to the git commit command that opens the editor to write the commit message
Return the input as a string
func GetCurrentBranch ¶
func GetHeadHash ¶
func GitCheckoutFileHead ¶
I prefer to use checkout because git reset gave me some problems When used with a file in args, git reset was thinking it was a directory. Because of that, git reset was just exiting with an error
func GitCommitAmend ¶
Amend the last commit with the message
func GitCommitAmendNoEdit ¶
func GitCommitAmendNoEdit() error
Amend the last commit but leave the message unchanged
func GitConfigPullRebaseTrueOnlyIfNotSet ¶
func GitConfigPullRebaseTrueOnlyIfNotSet() error
Set git config pull.rebase true only if not set to a value
func GitDeleteRemoteBranch ¶
Delete a remote branch
func GitDiffIndexCommit ¶
Diff the index with a given commit or branch and return true if there is no diff
func GitDiffIndexHead ¶
Diff the index with the HEAD and return true if there is no diff
func GitDiffRef ¶
Diff a ref to another ref and return true if there is no diff
func GitPullRebase ¶
Execute git pull --rebase using the exec package
func GitRemoteContainsHash ¶
Check if the remote contains the hash Used to check if the commit is already pushed to the remote
func GitResetAllHead ¶
func GitResetAllHead() error
func GitRmCached ¶
func GitRmCached() error
func IsDetachedHead ¶
func IsPathGitRepo ¶
func IsWorkTreeClean ¶
func ListAllCommits ¶
List all commits for the repo even if not on the current branch
func ListBranches ¶
func ListCommit ¶
List commit for the current branch
func RemoveRemote ¶
Types ¶
type CommitResult ¶
type FileStatus ¶
func GetStatus ¶
func GetStatus(path string) ([]FileStatus, error)