Help us shape the future of Go! Take the 2026 Go Developer Survey

repo

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureOnDefaultBranch added in v0.22.0

func EnsureOnDefaultBranch(repoPath string) error

EnsureOnDefaultBranch ensures that the repository is on the default branch (main or master). It dynamically detects the default branch and switches to it if necessary. It takes the repository path `repoPath` as input and returns an error if the operation fails.

func FetchBareRepo added in v0.14.3

func FetchBareRepo(repoPath string, workTree string) error

FetchBareRepo fetches updates for a bare repository. It takes the repository path `repoPath` and work tree `workTree` as inputs and returns an error if the operation fails.

func GetCurrentBranch added in v0.22.0

func GetCurrentBranch(repoPath string) (string, error)

GetCurrentBranch returns the current branch name for the repository.

func GetDevelopBranch added in v0.22.0

func GetDevelopBranch(repoPath string) (string, error)

GetDevelopBranch returns the development branch name for the repository (develop, dev, or development). It checks for common development branch names and returns the one that exists.

func GetMainBranch added in v0.22.0

func GetMainBranch(repoPath string) (string, error)

GetMainBranch returns the main branch name for the repository (main or master). It checks for both main and master branches and returns the one that exists.

func IsDirty

func IsDirty(repoPath string) (bool, error)

IsDirty checks if the repository at the given path has uncommitted changes. It takes the repository path `repoPath` as input and returns a boolean indicating whether the repository is dirty and an error if any occurs.

func PullLatestCode

func PullLatestCode(repoPath string) error

PullLatestCode pulls the latest changes from the current branch of the repository. It takes the repository path `repoPath` as input and returns an error if the operation fails. The function automatically detects the current branch and pulls from the corresponding remote.

func PullRebaseBareRepo added in v0.14.3

func PullRebaseBareRepo(repoPath string, workTree string) error

PullRebaseBareRepo performs a pull with rebase operation for a bare repository. It takes the repository path `repoPath` and work tree `workTree` as inputs and returns an error if the operation fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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