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
  • 6,249
  • 6
  • 28
  • 36
mars8
  • 770
  • 1
  • 11
  • 25

1 Answers1

-2

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

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

Amrendra K
  • 50
  • 1
  • 9
  • 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