Что-то заставляет Git автоматически «разрешать» конфликты слияния.Git неправильно распознает конфликты как разрешенные
Ниже фактическая, линия для вывода линии попытки слияния:
>> git status
On branch BRANCH-A
Your branch is up-to-date with 'origin/BRANCH-A'.
nothing to commit, working directory clean
>> git merge BRANCH-B
Auto-merging file1.css
CONFLICT (content): Merge conflict in file1.css
Auto-merging file2.css
Auto-merging file3.scss
CONFLICT (content): Merge conflict in file3.scss
Auto-merging file4.js
CONFLICT (content): Merge conflict in file4.js
Removing file5.js
Auto-merging file6.json
CONFLICT (add/add): Merge conflict in file6.json
Auto-merging file7.jsp
CONFLICT (content): Merge conflict in file7.jsp
Auto-merging file8.java
CONFLICT (content): Merge conflict in file8.java
Auto-merging file9.java
CONFLICT (content): Merge conflict in file9.java
Auto-merging file10.java
CONFLICT (content): Merge conflict in file10.java
Automatic merge failed; fix conflicts and then commit the result.
>> git st
On branch BRANCH-A
Your branch is up-to-date with 'origin/BRANCH-A'.
You have unmerged paths.
(fix conflicts and run "git commit")
Changes to be committed:
modified: .gitignore
modified: web.xml
deleted: file5.js
new file: someFile.js
renamed: otherFile.css -> anotherFile.css
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: file8.java
both modified: file7.jsp
both added: file6.json
both modified: file4.js
both modified: file3.scss
both modified: file1.css
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file9.java
modified: file10.java
>> git st
On branch BRANCH-A
Your branch is up-to-date with 'origin/BRANCH-A'.
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Changes to be committed:
modified: .gitignore
modified: web.xml
deleted: file5.js
new file: someFile.js
renamed: otherFile.css -> anotherFile.css
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file8.java
modified: file9.java
modified: file10.java
modified: file7.jsp
modified: file6.json
modified: file4.js
modified: file3.scss
modified: file1.css
Я знаю, что это немного многословный, но я хочу подчеркнуть, что это буквально все, что я сделал: слияние, проверить состояние GIT , а затем снова проверьте статус git. Во второй раз, когда я проверил статус git, он сказал, что все конфликты решены. В качестве альтернативы, если я запустил git mergetool
сразу после попытки слияния (и мой экран залит сообщениями CONFLICT), я получаю сообщение No files need merging
.
Я был безуспешным в том, чтобы найти какие-либо записи об этом, происходящем с кем-либо еще. Единственное, что мне удалось найти, это некоторые варианты конфигурации git, касающиеся trustExitCode
. Однако ни один из них не работал. Ради покрытия всех моих баз, вот мой файл ~/.gitconfig
.
[color]
ui = true
[core]
editor = vim
excludesfile = /Users/ganders/.gitignore_global
[alias]
st = status
co = checkout
br = branch
cm = commit
logtree = log --graph --decorate --abbrev-commit --pretty=format:'%C(auto)%h%Creset%C(auto)%d%Creset %s %Cgreen(%cr)%C(blue) [%an]%Creset'
[push]
default = simple
[credential]
helper = osxkeychain
[merge]
tool = opendiff
[mergetool "opendiff"]
cmd = /usr/bin/opendiff
trustExitCode = false
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
trustExitCode = false
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = false
Переключение между использованием git в командной строке и SourceTree. Моя версия командной строки Git - 2.3.6, установленная из Homebrew. Я уже попытался удалить и переустановить git, а также удалить и повторно клонировать мой репозиторий git, и все это не повезло.