git

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package git provides helper functions to execute common Git commands by wrapping the system's git binary using os/exec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(url, targetDir string, recurseSubmodules bool) error

Clone executes a git clone command for the given URL into the target directory. If recurseSubmodules is true, it appends the --recurse-submodules flag.

func CurrentBranch

func CurrentBranch(targetDir string) (string, error)

CurrentBranch retrieves the name of the currently checked-out branch.

func Pull

func Pull(targetDir string, recurseSubmodules bool) error

Pull executes a git pull --rebase --autostash command in the target directory. If recurseSubmodules is true, it appends the --recurse-submodules flag.

func RemoteOrigin

func RemoteOrigin(targetDir string) (string, error)

RemoteOrigin retrieves the remote origin URL of the target directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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