git

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommit added in v0.2.0

func CreateCommit(path, message string) error

CreateCommit creates a commit with the given message

func GetAllBranches added in v0.2.0

func GetAllBranches(path string) ([]string, error)

GetAllBranches returns a list of all branches (local and remote)

func GetBranchDiff added in v0.2.0

func GetBranchDiff(path, fromBranch, toBranch string) (string, error)

GetBranchDiff returns the diff between two branches

func GetCurrentBranch added in v0.2.0

func GetCurrentBranch(path string) (string, error)

GetCurrentBranch returns the current branch name

func GetDiff

func GetDiff(path string, staged bool) (string, error)

GetDiff retrieves the git diff for the specified path

func GetDiffForMode

func GetDiffForMode(path string, mode DiffMode) (string, error)

GetDiffForMode retrieves the git diff for a specific diff mode

func GetRemoteBranches added in v0.2.0

func GetRemoteBranches(path string) ([]string, error)

GetRemoteBranches returns a list of remote branches

func GetStagedFiles added in v0.2.0

func GetStagedFiles(path string) ([]string, error)

GetStagedFiles returns the list of staged files

func HasStagedChanges added in v0.2.0

func HasStagedChanges(path string) (bool, error)

HasStagedChanges checks if there are any staged changes

func IsGitRepository

func IsGitRepository(path string) bool

IsGitRepository checks if the given path is within a git repository

func PushBranch added in v0.2.0

func PushBranch(path string) error

PushBranch pushes the current branch to the remote repository

func StageAllFiles added in v0.2.0

func StageAllFiles(path string) error

StageAllFiles stages all files in the repository

Types

type DiffMode

type DiffMode int
const (
	DiffModeAll DiffMode = iota
	DiffModeStaged
	DiffModeUnstaged
)

Jump to

Keyboard shortcuts

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