Documentation
¶
Index ¶
- type Commander
- type Operations
- func (o *Operations) AddFile(filePath string) error
- func (o *Operations) ApplyCheckout() error
- func (o *Operations) Commit(message string) error
- func (o *Operations) CreateAndSwitchToBranch(branchName string) error
- func (o *Operations) DisableSparseCheckout() error
- func (o *Operations) FetchAll() error
- func (o *Operations) GetCommitHash() (string, error)
- func (o *Operations) GetCurrentBranch() (string, error)
- func (o *Operations) GetLocalBranches() (map[string]bool, error)
- func (o *Operations) GetRemoteBranches(defaultBranch string) (map[string]bool, error)
- func (o *Operations) GetShortCommitHash() (string, error)
- func (o *Operations) InitSparseCheckout() error
- func (o *Operations) InitSparseCheckoutCone() error
- func (o *Operations) IsRepository() (bool, error)
- func (o *Operations) MergeBranchToMain(branchName string) error
- func (o *Operations) PullMainFromRemote() error
- func (o *Operations) PushAllBranches() error
- func (o *Operations) PushBranch(branchName string) error
- func (o *Operations) SetSparseCheckoutPaths(paths []string) error
- func (o *Operations) SwitchToBranch(branchName string) error
- func (o *Operations) UpdateBranchFromMain(branchName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commander ¶
type Commander struct {
// contains filtered or unexported fields
}
Commander handles git command execution
func NewCommander ¶
NewCommander creates a new git commander
func (*Commander) RunCommand ¶
RunCommand runs a git command, either for real or simulate in dry-run mode
type Operations ¶
type Operations struct {
// contains filtered or unexported fields
}
Operations provides higher-level git operations
func NewOperations ¶
func NewOperations(dryRun bool) *Operations
NewOperations creates a new git operations handler
func (*Operations) AddFile ¶
func (o *Operations) AddFile(filePath string) error
AddFile stages a file for commit
func (*Operations) ApplyCheckout ¶
func (o *Operations) ApplyCheckout() error
ApplyCheckout applies sparse-checkout changes by reading the tree
func (*Operations) Commit ¶
func (o *Operations) Commit(message string) error
Commit creates a commit with the specified message
func (*Operations) CreateAndSwitchToBranch ¶
func (o *Operations) CreateAndSwitchToBranch(branchName string) error
CreateAndSwitchToBranch creates a new branch and switches to it
func (*Operations) DisableSparseCheckout ¶
func (o *Operations) DisableSparseCheckout() error
DisableSparseCheckout disables sparse-checkout using modern git command
func (*Operations) FetchAll ¶
func (o *Operations) FetchAll() error
FetchAll fetches all remote branches and tags
func (*Operations) GetCommitHash ¶
func (o *Operations) GetCommitHash() (string, error)
GetCommitHash returns the current commit hash
func (*Operations) GetCurrentBranch ¶
func (o *Operations) GetCurrentBranch() (string, error)
GetCurrentBranch returns the name of the currently checked out branch
func (*Operations) GetLocalBranches ¶
func (o *Operations) GetLocalBranches() (map[string]bool, error)
GetLocalBranches returns a map of local branch names
func (*Operations) GetRemoteBranches ¶
func (o *Operations) GetRemoteBranches(defaultBranch string) (map[string]bool, error)
GetRemoteBranches gets list of remote branch names without creating local tracking branches
func (*Operations) GetShortCommitHash ¶
func (o *Operations) GetShortCommitHash() (string, error)
GetShortCommitHash returns the short current commit hash
func (*Operations) InitSparseCheckout ¶
func (o *Operations) InitSparseCheckout() error
InitSparseCheckout initializes sparse-checkout using modern init command
func (*Operations) InitSparseCheckoutCone ¶
func (o *Operations) InitSparseCheckoutCone() error
EnableSparseCheckoutCone enables Git sparse-checkout with cone mode using modern init command
func (*Operations) IsRepository ¶
func (o *Operations) IsRepository() (bool, error)
IsRepository checks if the current directory is a Git repository
func (*Operations) MergeBranchToMain ¶
func (o *Operations) MergeBranchToMain(branchName string) error
MergeBranchToMain merges a specific branch into main
func (*Operations) PullMainFromRemote ¶
func (o *Operations) PullMainFromRemote() error
PullMainFromRemote pulls the latest changes from remote main
func (*Operations) PushAllBranches ¶
func (o *Operations) PushAllBranches() error
PushAllBranches pushes all local branches to remote
func (*Operations) PushBranch ¶
func (o *Operations) PushBranch(branchName string) error
PushBranch pushes a specific branch to remote
func (*Operations) SetSparseCheckoutPaths ¶
func (o *Operations) SetSparseCheckoutPaths(paths []string) error
SetSparseCheckoutPaths sets the sparse-checkout paths using git sparse-checkout command
func (*Operations) SwitchToBranch ¶
func (o *Operations) SwitchToBranch(branchName string) error
SwitchToBranch switches to the specified branch
func (*Operations) UpdateBranchFromMain ¶
func (o *Operations) UpdateBranchFromMain(branchName string) error
UpdateBranchFromMain updates a branch with the latest changes from main