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

gitdir

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Common added in v0.15.2

func Common() (string, error)

Common returns the path to the common .git directory shared by every worktree of the repository. In the main working tree it equals Get; inside a linked worktree Get returns .git/worktrees/<name> while Common returns the main .git. Files that must be shared across worktrees (the git-zf store) belong here.

func Get

func Get() (string, error)

Get returns the path to the .git directory for the current working tree. It resolves gitfiles, submodules, and linked worktrees via git rev-parse, without importing go-git. Inside a linked worktree this is the per-worktree dir (.git/worktrees/<name>), which is where MERGE_HEAD and friends live.

Types

This section is empty.

Jump to

Keyboard shortcuts

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