gitx

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitx wraps the git CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branch

func Branch(dir string) string

Branch returns the current branch name, or "" when detached.

func CommonDir

func CommonDir(dir string) (string, error)

CommonDir returns the absolute git directory shared by all worktrees.

func GitDir

func GitDir(dir string) (string, error)

GitDir returns the absolute per-worktree git directory.

func Head(dir string) string

Head returns the current commit, or "" in a repository without commits.

func LastCommitDate

func LastCommitDate(dir, path string) string

LastCommitDate returns the ISO-8601 committer date of the last commit touching path.

func Run

func Run(dir string, args ...string) (string, error)

Run executes git in dir and returns trimmed stdout.

func RunRaw

func RunRaw(dir string, args ...string) ([]byte, error)

RunRaw executes git in dir and returns raw stdout.

func Toplevel

func Toplevel(dir string) (string, error)

Toplevel returns the repository root containing dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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