在使用git时,空白对我来说是一种可怕的痛苦.
git config apply.whitespace=strip
Run Code Online (Sandbox Code Playgroud)
似乎会增加你获得冲突的机会(当你删除不需要的空格,然后其他合作者将剥离的空白视为对其提交的更改?)
我过去曾尝试过其他一些配置apply.whitespace,也许其他配置中的一个可以解决这个问题,或者可能还有其他设置来处理我刚才没有遇到的空白,但我还没有找到明确的如何到达我想要的地方.
我从不想在空白上再发生冲突.如果另一个提交者改变了空格,或者我改变了空格然后必须合并我自己的冲突,我真的不想知道它.如果有人通过更改空格将我的代码从K&R样式更改为One True Brace样式,我更喜欢git允许空白设置赢得而不必看到它的冲突.我只是不太关心空白想要看到它的冲突.
所以......有什么方法可以配置git来做到这一点?
如果它有任何区别,这是我的git版本,以及我当前的配置:
tchalvak:~/ninjawars$ git --version
git version 1.6.0.4
tchalvak:~/ninjawars$
git config --list
color.branch=auto
color.diff=auto
color.status=auto
color.branch.current=yellow reverse
color.branch.local=yellow
color.branch.remote=green
color.diff.meta=yellow bold
color.diff.frag=magenta bold
color.diff.old=red bold
color.diff.new=green bold
color.status.added=yellow
color.status.changed=green
color.status.untracked=cyan
gui.recentrepo=/home/tchalvak/zd/htdocs/cms
apply.whitespace=strip
user.name=****
user.email=****
alias.co=checkout
github.user=tchalvak
github.token=****
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=...@github.com:tchalvak/ninjawars.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
Run Code Online (Sandbox Code Playgroud) 在git合并期间解决冲突时,如何忽略NetBeans中的前导和尾随空格.
在"选项">"其他">"差异"下,可以将diff工具设置为忽略引导尾随空格,但这不会影响NetBeans合并工具.
git支持git merge -Xignore-all-space.是否有在NetBeans中传递此标志的方法?