Skip to main content

get_git_dir

Function get_git_dir 

Source
pub fn get_git_dir() -> Result<PathBuf>
Expand description

Get the absolute path to the git directory (.git folder or file).

In a linked worktree, this is the worktree-private administrative directory (.git/worktrees/<name>), not the directory shared with the main repository and its other worktrees. For a file git reads from the shared location regardless of which worktree is active (e.g. info/exclude), use get_git_common_dir instead.