Documentation
¶
Index ¶
- type Repository
- func (r *Repository) Checkout(branch string) error
- func (r *Repository) Commit(message string) error
- func (r *Repository) GetCurrentBranch() (string, error)
- func (r *Repository) GetRemoteInfo() (owner, repo string, err error)
- func (r *Repository) GetRemoteURL() (string, error)
- func (r *Repository) GetWorkDir() (string, error)
- func (r *Repository) HasChanges() (bool, error)
- func (r *Repository) Pull() error
- func (r *Repository) Push() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository represents a Git repository
func OpenRepository ¶
func OpenRepository(path string) (*Repository, error)
OpenRepository opens a git repository at the given path
func (*Repository) Checkout ¶
func (r *Repository) Checkout(branch string) error
Checkout switches to a different branch using git binary
func (*Repository) Commit ¶
func (r *Repository) Commit(message string) error
Commit creates a commit with all changes using git binary This ensures pre-commit hooks are executed
func (*Repository) GetCurrentBranch ¶
func (r *Repository) GetCurrentBranch() (string, error)
GetCurrentBranch returns the name of the current branch
func (*Repository) GetRemoteInfo ¶
func (r *Repository) GetRemoteInfo() (owner, repo string, err error)
GetRemoteInfo extracts owner and repo name from remote origin URL
func (*Repository) GetRemoteURL ¶ added in v1.2.1
func (r *Repository) GetRemoteURL() (string, error)
GetRemoteURL returns the URL of the origin remote
func (*Repository) GetWorkDir ¶
func (r *Repository) GetWorkDir() (string, error)
GetWorkDir returns the working directory path of the repository
func (*Repository) HasChanges ¶
func (r *Repository) HasChanges() (bool, error)
HasChanges checks if there are uncommitted changes (modified or staged files only, ignoring untracked)
func (*Repository) Pull ¶
func (r *Repository) Pull() error
Pull pulls latest changes from remote using git binary
func (*Repository) Push ¶
func (r *Repository) Push() error
Push pushes commits to remote using git binary. Automatically sets upstream for new branches.