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

前端 未结 22 1031
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 09:57

Mercurial has a way of printing the root directory (that contains .hg) via

hg root

Is there something equivalent in git to get the director

22条回答
  •  醉酒成梦
    2020-11-22 10:51

    Has --show-toplevel only recently been added to git rev-parse or why is nobody mentioning it?

    From the git rev-parse man page:

       --show-toplevel
           Show the absolute path of the top-level directory.
    

提交回复
热议问题