git

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Overview

Package git implements abstraction to the module git-module. It also provides for worktree commands not implemented in git-module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(url string, branch string, path string) error

Clone will clone a git repository, checkout a branch, to a path provided.

func DeleteBranch added in v0.2.0

func DeleteBranch(branch string) error

DeleteBranch will delete a local branch from the repository.

func GetBranches added in v0.2.0

func GetBranches() ([]string, error)

GetBranches will retrieve local branches from the repository.

func GetRemote added in v0.2.0

func GetRemote(directory string) (string, error)

GetRemote will get the remote URL for the origin.

func GetRemoteDefaultBranch added in v0.3.0

func GetRemoteDefaultBranch(url string) (string, error)

GetRemoteDefaultBranch will retrieve the default branch from a remote git repository.

func GetRemoteRefId added in v0.3.0

func GetRemoteRefId(url string, ref string) (string, error)

GetRemoteRefId will retrieve the commit id for a given ref.

func WorktreeAdd

func WorktreeAdd(config *cmn.CfgMk, worktree string, commitish string) ([]byte, error)

WorktreeAdd will add a worktree to the project.

func WorktreeList

func WorktreeList(porcelain bool) ([]byte, error)

WorktreeList will list all worktrees in the project.

func WorktreeMove

func WorktreeMove(config *cmn.CfgMv, wtOriginal string, wtNew string) ([]byte, error)

WorktreeMove will move a worktree within the project.

func WorktreeRemove

func WorktreeRemove(config *cmn.CfgRm, worktree string) ([]byte, error)

WorktreeRemove will remove a worktree from the project.

Types

This section is empty.

Jump to

Keyboard shortcuts

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