使用Windows 7,git 1.9.5.msysgit.1
我阅读了关于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
有什么阻止我审查我的冲突吗?
编辑:
顺便说一下,这个答案没有帮助我。我似乎没有任何 .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