Documentation
¶
Index ¶
- func Add(dir string, patterns ...string) error
- func Checkout(dir string, ref string) error
- func Commit(dir string, message string) error
- func CreateBranch(dir string, name string) error
- func CreateWorktree(repoDir string, branch string, worktreeDir string) error
- func CurrentBranch(dir string) (string, error)
- func GetVersion() (string, error)
- func Init(dir string) error
- func IsGitInstalled() bool
- func IsRepo(dir string) bool
- func SetupTestConfig(dir string) error
- type Git
- func (g *Git) Add(patterns ...string) error
- func (g *Git) AddCommit(message string) error
- func (g *Git) AddRemote(name, url string) error
- func (g *Git) Checkout(ref string) error
- func (g *Git) Commit(message string) error
- func (g *Git) CreateBranch(name string) error
- func (g *Git) CreateBranchWithChanges(branch string, changes map[string]string) error
- func (g *Git) CreateWorktree(path, branch string) error
- func (g *Git) CurrentBranch() (string, error)
- func (g *Git) GetConfig(key string) (string, error)
- func (g *Git) GetRootDir() (string, error)
- func (g *Git) HasUncommittedChanges() (bool, error)
- func (g *Git) ListRemotes() ([]Remote, error)
- func (g *Git) ListWorktrees() ([]string, error)
- func (g *Git) PruneWorktrees() error
- func (g *Git) Pull(remote, branch string) error
- func (g *Git) Push(remote, branch string) error
- func (g *Git) RemoveRemote(name string) error
- func (g *Git) RemoveWorktree(name string) error
- func (g *Git) SetConfig(key, value string) error
- func (g *Git) SetUser(name, email string) error
- func (g *Git) Status() (string, error)
- type Remote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBranch ¶
CreateBranch creates a new branch
func CreateWorktree ¶
CreateWorktree creates a new git worktree
func CurrentBranch ¶
CurrentBranch returns the current branch name
func SetupTestConfig ¶
SetupTestConfig configures a repo with test defaults
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git represents a git repository
func CreateTestRepo ¶
CreateTestRepo creates a git repository with initial content
func SetupTestRepo ¶
SetupTestRepo configures a repo with test defaults
func (*Git) CreateBranch ¶
CreateBranch creates a new branch
func (*Git) CreateBranchWithChanges ¶
CreateBranchWithChanges creates a new branch and makes changes
func (*Git) CreateWorktree ¶
CreateWorktree creates a new git worktree
func (*Git) CurrentBranch ¶
CurrentBranch returns the current branch name
func (*Git) GetRootDir ¶
GetRootDir returns the root directory of the git repository
func (*Git) HasUncommittedChanges ¶
HasUncommittedChanges checks if there are uncommitted changes
func (*Git) ListRemotes ¶
ListRemotes returns all configured remotes
func (*Git) ListWorktrees ¶
ListWorktrees returns a list of all worktrees
func (*Git) PruneWorktrees ¶
PruneWorktrees removes references to deleted worktrees
func (*Git) RemoveRemote ¶
RemoveRemote removes a remote
func (*Git) RemoveWorktree ¶
RemoveWorktree removes a git worktree