Something is causing Git to automatically "resolve" merge conflicts.
Below is the actual, line for line output of an attempted merge:
>> 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
I know that's a bit verbose, but I want to emphasize that that is literally all I did: merge, check git status, and then check git status again. The second time I checked git status it said all the conflicts were resolved. Alternatively, if I run git mergetool
immediately after I attempt the merge (and my screen is flooded with CONFLICT messages), I get the message that No files need merging
.
I have been entirely unsuccessful at finding any record of this happening to anyone else. The only thing I've been able to find is some git config options concerning trustExitCode
. However, none of those worked either. For the sake of covering all my bases, here is my ~/.gitconfig
file.
[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
I alternate between using git on the command line and SourceTree. My command line version of Git is 2.3.6 installed from Homebrew. I've already tried uninstalling and reinstalling git as well as deleting and re-clonining my git repository, all with no luck.