Skip to main content

!git.root

The !git.root Atmos YAML function returns the absolute root directory of the current Git worktree. It is an alias of !repo-root — both resolve identically.

Usage

# Get the root directory of the current Git repository.
# If the Git root cannot be resolved, it returns a default value if specified; otherwise, it returns an error.
!git.root <default-value>

Examples

vars:
base_path: !git.root

# With a fallback value if the Git repository root is not present.
base_path_safe: !git.root <default-value>
  • !repo-root — identical function, kept for naming-convention consistency with the other !git.* functions