我有一个这样的 gitconfig:
[alias]
l = "!source ~/.githelpers && pretty_git_log"
当我运行它时,我得到了这个:
[desktop] git l
source ~/.githelpers && pretty_git_log: 1: source: not found
error: cannot run source ~/.githelpers && pretty_git_log: No such file or directory
fatal: While expanding alias 'l': 'source ~/.githelpers && pretty_git_log': No such file or directory
当我添加任何其他 shell 内置函数进行测试时,它们运行良好:
[alias]
l = "!echo running from the builtin"
[desktop] git l
running from the builtin
知道为什么无法从 git 中找到源命令吗?我正在运行 zsh,但更改为 bash 似乎没有什么不同:
[desktop] bash
[desktop] git l
source ~/.githelpers && pretty_git_log: 1: source: not found
error: cannot run source ~/.githelpers && pretty_git_log: No such file or directory
fatal: While expanding alias 'l': 'source ~/.githelpers && pretty_git_log': No such file or directory