Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

You have both xxx and xxx/yyy.zz error: Error building trees

Tags:

git

When I run git status I have something like:

$ git status
# On branch assets
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   index.html
#   new file:   sections
#   new file:   sections/asset/asset.ctrl.js
#   new file:   sections/asset/asset.tpl.html
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   deleted:    sections

The sections directory has existed since the project started, so not sure why it thinks it's a new file or needs to be deleted. When I try to commit I get:

You have both sections and sections/asset/asset.ctrl.js
error: Error building trees

Any ideas how I can commit my work?

like image 568
jkns.co Avatar asked May 28 '15 16:05

jkns.co


1 Answers

I fix this error by

git rm -r --cached sections          
git commit -m "blalblalba"       
git add .    
git commit -m "2blablalbla"
like image 98
Valeriy Smolyakov Avatar answered Oct 01 '22 19:10

Valeriy Smolyakov