gitgo

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checkout

func Checkout(ref string, worktree *git.Worktree) error

func CheckoutCommit

func CheckoutCommit(hash string, worktree *git.Worktree) error

CheckoutCommit checks out a specific commit hash

func CheckoutTag

func CheckoutTag(tag string, worktree *git.Worktree) error

CheckoutTag checks out a specific tag

func CloneGit

func CloneGit(dst string, rconf RemoteConfig) (*git.Repository, error)

func GetCurrentBranch

func GetCurrentBranch(repo *git.Repository) (string, error)

func InitGit

func InitGit(dst string) (*git.Repository, error)

func IsBranch

func IsBranch(repo *git.Repository) bool

func IsDetached

func IsDetached(repo *git.Repository) bool

func IsDirty

func IsDirty(worktree *git.Worktree) bool

func IsTag

func IsTag(repo *git.Repository) bool

func OpenGit

func OpenGit(dst string) (*git.Repository, error)

func Pull

func Pull(conf RemoteConfig, repo *git.Repository) error

Pull fetches from remote and merges into current branch

func Push

func Push(conf RemoteConfig, repo *git.Repository) error

func TreeHash

func TreeHash(dir string, repo *git.Repository) (string, error)

TreeHash retrieves the Git tree object hash for the specified directory

func UncommitFiles

func UncommitFiles(worktree *git.Worktree) ([]string, error)

UncommitFiles returns a list of files that have been modified but not committed

func UntrackedFiles

func UntrackedFiles(worktree *git.Worktree) ([]string, error)

UntrackedFiles returns a list of files that are not tracked by Git

Types

type GitCommitLog

type GitCommitLog struct {
	Hash    string
	Author  string
	When    time.Time
	Message string
}

func Log

func Log(offset, limit int, repo *git.Repository) ([]GitCommitLog, error)

Log returns commit history with pagination support

func RemoteLog

func RemoteLog(offset, limit int, conf RemoteConfig, repo *git.Repository) ([]GitCommitLog, error)

RemoteLog retrieves commit logs from remote repository with pagination support

type GitReference

type GitReference struct {
	RefType string
	Name    string
}

func GetCurrentReference

func GetCurrentReference(repo *git.Repository) (GitReference, error)

type GitStatus

type GitStatus string
const (
	StatusBranch  GitStatus = "branch"
	StatusTag     GitStatus = "tag"
	StatusCommit  GitStatus = "commit"
	StatusUnknown GitStatus = "unknown"
)

func GetCurrentGitStatus

func GetCurrentGitStatus(repo *git.Repository) (GitStatus, string, error)

type OpenConfig

type OpenConfig struct {
	Dir    string
	Branch string
}

type RemoteConfig

type RemoteConfig struct {
	User     string
	Token    string
	Upstream string
	Branch   string
}

Jump to

Keyboard shortcuts

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