Which shell used for git '!' aliases?

前端 未结 1 1993
一整个雨季
一整个雨季 2021-01-15 11:51

What default shell is used by git when executing an alias starting with !?

I\'m suspecting it\'s /bin/sh, because I\'m getting different be

相关标签:
1条回答
  • 2021-01-15 12:02

    As described here, you can see more with:

    GIT_TRACE=1 git test
    

    The workaround is to create a shell script (whose first line can be a shebang #!/bin/bash) named git-xxx. Then any git xxx call would invoke that script (provided it is in the $PATH).

    As the OP Tom Hale adds in the comments, /bin/sh is used:

    trace: exec: '/bin/sh' '-c' 'echo Which shell?' 
    'echo Which shell?'
    
    0 讨论(0)
提交回复
热议问题