git

package
v0.0.0-...-0c5fcde Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitFile

func CommitFile(filePath, message string, push bool) error

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

func CommitFiles(filePaths []string, message string, push bool) error

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

func FindRepoRoot(path string) (string, error)

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 Init

func Init(path string) error

Init initializes a git repository at the given path

func InitAndCommit

func InitAndCommit(path, message string) error

InitAndCommit initializes a git repository and makes an initial commit

func IsGitRepo

func IsGitRepo(path string) bool

IsGitRepo checks if the given path is inside a git repository

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL