HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git root — Print the root directory of the current Git repository. Part of `git-extras`. More information: <htt

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thedirectorycommandcliprintgit rootroot

Problem

How to use the git root command: Print the root directory of the current Git repository. Part of git-extras. More information: <https://github.com/tj/git-extras/blob/main/Commands.md#git-root>.

Solution

git root — Print the root directory of the current Git repository. Part of git-extras. More information: <https://github.com/tj/git-extras/blob/main/Commands.md#git-root>.

Print the absolute path of the current Git repository:
git root


Print the current working directory relative to the root of the current Git repository:
git root {{[-r|--relative]}}

Code Snippets

Print the absolute path of the current Git repository

git root

Print the current working directory relative to the root of the current Git repository

git root {{[-r|--relative]}}

Context

tldr-pages: common/git root

Revisions (0)

No revisions yet.