我.gitconfig
在 Windows 上的文件中添加了一行:
[alias]
hist = log --pretty=format:"%C(yellow)%h [%ad]%C(reset) | %s%d %C(green)(%cr)%C(reset) by %C(blue)%an%C(reset)" --graph --all --decorate --date=short
如果我从 git 命令行(如git log --pretty=...
)使用此代码,它可以正常工作。但是当我使用别名时,我得到了这个错误:
$git hist
fatal: |: no such path in the working tree.
Use 'git <command> -- <path>...' to specify paths that do not exist locally.
据我了解,问题出在“|” 象征。它被命令行解释为路径。我应该以某种方式隔离它,还是其他什么?