git

package
v0.0.0-...-a981ce0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotInitializedErr = fmt.Errorf("git repository has not been initialized")

NotInitializedErr is raised if the repository has not been initialized.

View Source
var RepoIsDirtyErr = fmt.Errorf("repository has unstaged changes")

RepoIsDirtyErr is raised if the repository has unstaged changes.

Functions

func Checkout

func Checkout(branch string) error

Checkout branch by name.

func CreateBranch

func CreateBranch(name string) error

CreateBranch creates a new git branch.

func CurrentBranch

func CurrentBranch() (string, error)

CurrentBranch returns the current branch for this Git repo.

func ProjectName

func ProjectName() (string, error)

ProjectName extracts the project name from the remote info.

func Pull

func Pull() error

Pull gets new changes from the remote repo.

func RepoIsClean

func RepoIsClean() bool

RepoIsClean returns false if there are changes in the repo.

func RootDir

func RootDir() string

RootDir is the root directory of the Git project. Reference: https://stackoverflow.com/a/957978

Types

This section is empty.

Jump to

Keyboard shortcuts

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