boa*_*der 105 git config git-config
我可能会设置一个别名,但似乎我应该能够将其设置为配置文件中的一个选项,但我无论如何也看不到它.
我只想要--ignore-space-change我做差异的时候,而不是在我申请时或其他任何事情.我试图通过不使用对它们没有真正改变的无关+/-线来使差异更容易理解.
小智 95
如果您使用的是shell-available OS,则可以使用git别名或bash别名.
git别名:运行此命令添加别名:
git config --global alias.dfw 'diff --ignore-space-change'
--ignore-space-change can be abbreviated to -w
使用以下方法应用别名: git dfw
bash别名:运行此命令添加bash别名:
echo "alias gitdfw='git diff --ignore-space-change'">>~/.profile
打开一个新的终端,你可以直接运行gitdfw来实现相同的目标.
小智 9
编辑:我是一个傻瓜,并没有通过你的请求阅读
从以下方面实现类似的方法man git-config:
apply.whitespace
Tells git apply how to handle whitespaces, in the same way
as the --whitespace option. See git-apply(1).
Run Code Online (Sandbox Code Playgroud)
所以打开你的~/.gitconfig或者./.git/config/追加
[apply]
whitespace = nowarn
Run Code Online (Sandbox Code Playgroud)
它也可能不会让你提交只改变空格的东西,但我相信你可以用一些标志来否决它.
| 归档时间: |
|
| 查看次数: |
61930 次 |
| 最近记录: |