Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git - error: addinfo_cache failed for path 'file'

Tags:

When I try to merge any branch in git into master I get error: addinfo_cache failed for path 'file'.

What I do:

>git checkout master >git merge other-branch 

Git gives me:

error: addinfo_cache failed for path 'file' file: unmerged (581c47f7d0e1a0bc825d528d9783ac18ee0cce27) file: unmerged (26a0c24dccd2bc2f74e20488ca01bba2fcd9cf56) file: unmerged (3be471ca5c689693339827a455f187814677642f) fatal: git write-tree failed to write a tree 

>git status yields:

On branch master Your branch is up-to-date with 'origin/master'. Unmerged paths:   (use "git reset HEAD <file>..." to unstage)   (use "git add <file>..." to mark resolution)          both modified:   file  no changes added to commit (use "git add" and/or "git commit -a") 

I have no idea what to do and can't find anython on the problem.

like image 753
DerWeh Avatar asked Jan 03 '18 15:01

DerWeh


2 Answers

This error can occur when you have changed the core.autocrlf config option but have not deleted and re-checked-out your working tree.

So either change core.autocrlf back to what it was, or push up your changes, delete your repo and clone it again.

like image 144
Robin Green Avatar answered Sep 30 '22 14:09

Robin Green


I tried editing the above answer but it does not seem to have progressed... After looking at your comment https://stackoverflow.com/users/6950750/derweh, deleting a repo is the absolute last resort. When quirky things seem to happen such as above. I found the best thing to do is reset to a past commit that has some considerable amount of delta and then checking back out the branch you need.

git reset HEAD~10 --hard or git checkout some-other-branch

followed by

git checkout name-of-your-branch

After doing this, your working branch often appears to work again.

like image 35
Gregory A. Owen Avatar answered Sep 30 '22 12:09

Gregory A. Owen