0

what is the git command to see the path for local git repository? E.g.

My Directory: C:\Users\AndroidStudioProjects\MyProjectDirectory

Git Location: C:\Users\AndroidStudioProjects\MyProjectDirectory\.git

what is the git command to return C:\Users\AndroidStudioProjects\MyProjectDirectory\.git?

Biffen
  • 5,791
  • 5
  • 29
  • 34
mairs8
  • 81
  • 1
  • 7

1 Answers1

-2

Below is command to show current directory path but without .git

echo "$(git rev-parse --show-toplevel)"

Amrendra K
  • 46
  • 7
  • 4
    I don't think the `echo $(...)` adds anything here. From the dupe, consider `git rev-parse --git-dir` to print it _with_ the `.git`, as requested. – Joe Sep 20 '21 at 11:38
  • your command doesnot return directory name.It jsut shows .git . Try run your command in git system – Amrendra K Sep 20 '21 at 11:46
  • 2
    @Joe `--absolute-git-dir` – phd Sep 20 '21 at 14:20