使用Windows 7,混帐1.9.5.msysgit.1Git的合并 - 冲突标记缺少
我读过有关合并冲突Git中教程提示,失败的合并将导致冲突标志被放置在有问题的点在文件中。我似乎无法得到此发生。这里是一个新的存储库中的样本工作流程:
git init
notepad file1.txt #make some edits
git add .
git commit -m "msg"
git branch mybranch
git checkout mybranch
notepad file1.txt #make some edits on line 3
git add .
git commit -m "msg"
git checkout master
notepad file1.txt #make a conflicting edit on line 3
git add .
git commit -m "msg"
git merge mybranch
#error: 'merge' is not possible because you have unmerged files
notepad file1.txt
打开FILE1.TXT最后一次后,我期待看到标志>>>>>>>>和======== ==第3行左右的冲突标记......但没有任何内容,只是文件出现在主分支中。我的全球的.gitconfig文件:
[user]
name = Andrew Barger
[core]
[core]
attributesfile = ~/.gitattribtues
editor = 'C:\\Program Files (x86)\\Vim\\VIM74\\gvim.exe'
[merge]
conflictStyle = diff3
[rerere]
enabled = true
什么阻止我回顾我的冲突?顺便说一句,编辑: This answer没有帮助我。我似乎没有任何.gitattributes文件。在这里,虽然是gitconfig --list
输出,如果这能帮助:
PS C:\GitRepos\git_sandbox> git config --list
core.symlinks=false
core.autocrlf=true
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=Andrew Barger
core.attributesfile=~/.gitattribtues
core.editor='C:\Program Files (x86)\Vim\VIM74\gvim.exe'
merge.conflictstyle=diff3
rerere.enabled=true
alias.edit-unmerged=!f() { git diff --name-status --diff-filter=U | cut -f2 ; }; vim `f`
alias.add-unmerged=!f() { git diff --name-status --diff-filter=U | cut -f2 ; }; git add `f`
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
如果您运行'git gui'尝试手动合并,您会看到什么? – azurefrog
它注意到它需要合并冲突,但没有显示文件内容。相反,我看到一条消息说'二进制文件不同'...检查我的测试文件,我发现它出于某种原因被编码为UTF-16 ...我会看到如果我重复使用UTF- 8文件。 – FolksymAndrew
@azurefrog它是文件编码...只要我使用UTF-8冲突标记出现。我觉得自己像个假人。如果只有Git让我知道它试图比较它认为是二进制的东西! – FolksymAndrew