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
  • 27,330
  • 37
  • 120
  • 195

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,396
  • 1
  • 20
  • 24