git

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package git provides utilities for interacting with Git repositories including operations for branches, commits, and worktrees.

Index

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

Jump to

Keyboard shortcuts

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