vcs

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

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