0

Possible Duplicate:
Is there a way to get the git root directory in one command?

Let's say the repository starts at

C:\myrepo\
and the prompt is at 
C:\myrepo\folderone\folderoneb\folderonec

I need a batch script that can go up until it finds

C:\myrepo.git and return C:\myrepo
Community
  • 1
  • 1
user391986
  • 29,536
  • 39
  • 126
  • 205

1 Answers1

1

See Is there a way to get the git root directory in one command?

Just use the command git rev-parse --show-toplevel and use its output in the way you need

And yes, this works on Windows, too ;)

Community
  • 1
  • 1
klaustopher
  • 6,702
  • 1
  • 22
  • 25