Documentation
¶
Index ¶
- func Add(repoPath, path string, dryRun bool) error
- func CheckoutDefaultBranch(repo *git.Repository, repoPath string) (plumbing.ReferenceName, error)
- func Clone(dir, url string) error
- func Commit(repoPath, commitMessage string, dryRun bool) error
- func CreateRemote(repo *git.Repository, name, url string, dryRun bool) error
- func DiffUnstaged(path string) error
- func EnsureGitRepo(repoPath string) error
- func GetCurrentBranch(repository *git.Repository) (string, error)
- func GetDefaultBranch(repo *git.Repository, repoPath string) (plumbing.ReferenceName, error)
- func GetExcludesFiles() ([]gitignore.Pattern, error)
- func HasBranch(repository *git.Repository, name string) bool
- func Init(repoPath string, commit bool, gitName, gitEmail string) error
- func IsClean(repoPath string) (bool, error)
- func Push(repoDir string, remote string, tags bool, dryRun bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutDefaultBranch ¶
func CheckoutDefaultBranch(repo *git.Repository, repoPath string) (plumbing.ReferenceName, error)
CheckoutDefaultBranch checks out the default branch of a repository.
func CreateRemote ¶
CreateRemote creates a new git remote in a repository
func DiffUnstaged ¶
DiffUnstaged shows a `git diff`. Due to limitations in the underlying go-git library, this implementation requires the /usr/bin/git binary. It gracefully skips if it cannot find the command on the system.
func EnsureGitRepo ¶
EnsureGitRepo ensures a git repo .git folder exists
func GetCurrentBranch ¶
GetCurrentBranch retrieves the current branch of a repository.
func GetDefaultBranch ¶
func GetDefaultBranch(repo *git.Repository, repoPath string) (plumbing.ReferenceName, error)
GetDefaultBranch retrieves the default branch of a repository.
func GetExcludesFiles ¶
GetExcludesFiles reads the exlude files from a global gitignore
func HasBranch ¶
Check if a branch exists in a repo. Use this and not repository.Branch(), because the latter does not actually check for existing branches. See https://github.com/gogit/gogit/issues/518 for more.
Types ¶
This section is empty.