Documentation
¶
Index ¶
- func CommitFile(filePath, message string, push bool) error
- func CommitFiles(filePaths []string, message string, push bool) error
- func FindRepoRoot(path string) (string, error)
- func GetSignature(repo *git.Repository) *object.Signature
- func Init(path string) error
- func InitAndCommit(path, message string) error
- func IsGitRepo(path string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitFile ¶
CommitFile stages and commits a single file with the given message. If push is true and remotes exist, it will also push to the remote. Returns nil if the file is not in a git repo.
func CommitFiles ¶
CommitFiles stages and commits multiple files with the given message. If push is true and remotes exist, it will also push to the remote. All files must be in the same repository.
func FindRepoRoot ¶
FindRepoRoot finds the root of the git repository containing the given path
func GetSignature ¶
func GetSignature(repo *git.Repository) *object.Signature
GetSignature returns a git signature using the user's configured git identity. It checks local repo config first, then global config, falling back to defaults.
func InitAndCommit ¶
InitAndCommit initializes a git repository and makes an initial commit
Types ¶
This section is empty.