我知道我可以在git grep中使用-n标志来显示结果的行号,即
git grep -n "some string"
Run Code Online (Sandbox Code Playgroud)
但是如何在默认情况下包含此标志而不会产生别名?我发现git config --global grep.lineNumber true但它似乎并没有为我工作.
Tho*_*ner 37
从git grep手册:
Options:
-n, --line-number
Prefix the line number to matching lines.
Run Code Online (Sandbox Code Playgroud)
Configuration:
grep.lineNumber
If set to true, enable -n option by default.
Run Code Online (Sandbox Code Playgroud)
要全球启用: git config --global grep.lineNumber true
Kit*_* Ho 19
在.gitconfig文件下
添加此部分
[grep]
linenumber = true
Run Code Online (Sandbox Code Playgroud)
如果您使用git grep,将显示行号
小智 6
您使用的命令
git config --global grep.lineNumber true
Run Code Online (Sandbox Code Playgroud)
是默认情况下启用-n选项的正确方法.
但是直到v1.7.5-rc1才能使用此功能.有关更多信息,请查看本地文档.
git grep --help
Run Code Online (Sandbox Code Playgroud)
如果您有兴趣,这里提交此功能的提交:
| 归档时间: |
|
| 查看次数: |
10479 次 |
| 最近记录: |