git aliases operate in the wrong directory

后端 未结 2 1836
清歌不尽
清歌不尽 2020-12-15 06:22

Summary: the current working directory of commands run through git aliases is wrong.

The easiest way to demonstrate this is to have a git alias like so:



        
2条回答
  •  猫巷女王i
    2020-12-15 07:05

    This is clearly specified in the documentation as by design along with a workaround if needed.

    Git Config Alias

    Note that shell commands will be executed from the top-level directory of a repository, which may not necessarily be the current directory. GIT_PREFIX is set as returned by running git rev-parse --show-prefix from the original current directory

提交回复
热议问题