Documentation
¶
Overview ¶
Package git provides utilities for interacting with Git repositories including operations for branches, commits, and worktrees.
Index ¶
- type Repository
- func (r *Repository) AddWorktree(name, path string) error
- func (r *Repository) CheckoutBranch(name string) error
- func (r *Repository) CreateBranch(name string) error
- func (r *Repository) DeleteBranch(name string) error
- func (r *Repository) GetCurrentBranch() (string, error)
- func (r *Repository) GetWorktreePath(name string) (string, error)
- func (r *Repository) IsClean() (bool, error)
- func (r *Repository) ListWorktrees() ([]string, error)
- func (r *Repository) Push(remoteName string, branchName string) error
- func (r *Repository) RemoveWorktree(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
*git.Repository
// contains filtered or unexported fields
}
Repository represents a Git repository
func Open ¶
func Open(path string) (*Repository, error)
Open opens a Git repository at the given path
func (*Repository) AddWorktree ¶
func (r *Repository) AddWorktree(name, path string) error
AddWorktree adds a new worktree to the repository
func (*Repository) CheckoutBranch ¶
func (r *Repository) CheckoutBranch(name string) error
CheckoutBranch checks out the specified branch
func (*Repository) CreateBranch ¶
func (r *Repository) CreateBranch(name string) error
CreateBranch creates a new branch from the current HEAD
func (*Repository) DeleteBranch ¶
func (r *Repository) DeleteBranch(name string) error
DeleteBranch deletes a branch
func (*Repository) GetCurrentBranch ¶
func (r *Repository) GetCurrentBranch() (string, error)
GetCurrentBranch returns the name of the current branch
func (*Repository) GetWorktreePath ¶
func (r *Repository) GetWorktreePath(name string) (string, error)
GetWorktreePath returns the path of a worktree
func (*Repository) IsClean ¶
func (r *Repository) IsClean() (bool, error)
IsClean checks if the working directory is clean
func (*Repository) ListWorktrees ¶
func (r *Repository) ListWorktrees() ([]string, error)
ListWorktrees returns a list of worktrees in the repository
func (*Repository) Push ¶
func (r *Repository) Push(remoteName string, branchName string) error
Push pushes the current branch to the remote repository
func (*Repository) RemoveWorktree ¶
func (r *Repository) RemoveWorktree(name string) error
RemoveWorktree removes a worktree from the repository