开发者

Can git tell me what the current managed base path is

Assuming I am somewhere in a repository managed by git, which is based at some path. I.e.:

/home/whatever/username/MyRepository/a/b/c

where everything under

/home/whatever/username/MyRepository

is under git control.

Is there a git command I can run from some arbitrary location under the managed path which returns the base path (in this case

/home/whatever/username/MyRepository

)? I could reverse s开发者_JAVA百科earch through the directory structure, and wait to find the .git directory, but that seems exceptionally hackish.

Thanks!


This:

git rev-parse --show-toplevel
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜