有没有办法在将文件输入三路合并工具之前完全关闭git尝试解决冲突的方式?
我的意思是这些行:
<<<<<<< Temporary merge branch 1
...
=======
...
>>>>>>> Temporary merge branch 2
它将它们与分支更改添加到基本文件中,然后将其馈送到kdiff3中,后者变得完全疯狂,显示奇怪的冲突。
我希望只保留基本版本不变。
到目前为止,我仅找到了这个选项
merge.conflictstyle
但似乎没有关闭这些行的选项。
除了编写预处理程序以剥离这些行之外,还有其他方法吗?
更新
我将解释我不喜欢的内容。
问题在于,当git启动kdiff3时,基本版本包含像下面这样的行:
X1
<<<<<<< Temporary merge branch 1
A
=======
B
>>>>>>> Temporary merge branch 2
X2
本地修订包含以下内容:
X1
A
X2
远程版本包含以下内容:
X1
B
X2
这里的X1
和X2
是3个文件中的一些常见代码行。
现在,kdiff3在这里发出了冲突信号。
如果我将这些文件复制到一个单独的文件夹中,并删除<
和>
之间的所有内容,那么kdiff3就能更好地合并文件,有时甚至自动完成。
从http://www.gitguys.com/topics/merging-with-a-gui/上看,实际上它不应该显示基础版本中的行。但它确实这样做了。我该怎么办呢?
Git配置
git config -l
返回如下:
core.symlinks=false
core.autocrlf=false
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=Pavel Gatilov
user.email=********
merge.tool=kdiff3
mergetool.kdiff3.path=C:/Program Files (x86)/KDiff3/kdiff3.exe
diff.guitool=kdiff3
difftool.kdiff3.path=C:/Program Files (x86)/KDiff3/kdiff3.exe
difftool.kdiff3.cmd="C:/Program Files (x86)/KDiff3/kdiff3.exe" "$LOCAL" "$REMOTE"
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
core.autocrlf=false
credential.helper=!"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe"
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
core.safecrlf=true
remote.origin.url=********
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop
gui.wmstate=normal
gui.geometry=887x427+175+175 171 192
branch.8480-il.remote=origin
branch.8480-il.merge=refs/heads/8480-il
branch.branch-9354.remote=origin
branch.branch-9354.merge=refs/heads/branch-9354
版本
我使用的工具及版本如下:
工具 版本号 ------------------------ msysgit 1.8.1.msysgit.1 Git Extensions 2.44 kdiff3 0.9.97
无论是通过 Git Extensions 还是通过 git mergetool
运行合并时,都存在问题。
更新2
我已尝试配置 kdiff3 预处理程序命令以删除文件中不需要的部分,但它似乎是基于每行的基础工作的,因此无法解决这个问题。
我可以编写一个预处理包装器,但我现在不想这样做。