Jamie Hutber
Jamie Hutber

Reputation: 28064

You have both xxx and xxx error: Error building trees git

Very confused by this error from git today:

You have both sdapp/app/www and sdapp/app/www/config.xml
error: Error building trees

git did not exit cleanly (exit code 1) (109 ms @ 16/10/2013 23:38:35)

Now, while I am not 100% sure and can't find out how to test this, but I believe that config.xml may have been committed and deleted at some point. Not helpful I know, but this is the only thing that I can think of that might cause this error...

Question

How can I add this file without getting this error?

Upvotes: 3

Views: 2329

Answers (2)

Johan
Johan

Reputation: 40500

My workaround was to move everything to a new local branch and then rebase against this branch. Step-by-step I did like this:

git checkout -b temp
git commit -am "Commit description"
git checkout master
git pull --rebase
git checkout temp
git rebase master
git checkout master
git rebase temp
git push
git branch -d temp # To remove temporary branch

This solved it for me.

Upvotes: 0

Emil Davtyan
Emil Davtyan

Reputation: 14089

My hunch is you have a symbolic link in the sdapp/app/ directory called www while also having a www directory which I believe is possible.

Try :

cd sdapp/app/
rm www

Upvotes: 3

Related Questions