Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git submodule update fatal error: reference is not a tree

user$ sudo git submodule update fatal: reference is not a tree: a094dcfeeb43fcd62a9e466156e05e7581026f33 Unable to checkout 'a094dcfeeb43fcd62a9e466156e05e7581026f33' in submodule path 'client/src/util' 

What do I do? I just want to get a clean copy of the latest code from the repo, i dont mind losing my changes. As you can tell, I clearly am not sure what is happening. I can only think that it is trying to checkout a file which means git detected a local change in a file on my local machine.

i am currently using OSX

like image 266
bouncingHippo Avatar asked Nov 16 '12 22:11

bouncingHippo


1 Answers

This is the most common problem with submodules. The commit that you are on in the outer repository has a reference to a commit in the submodule that someone did not push up yet. It's a dependency problem. Always push from the inside-out. This is most likely not something you did wrong, but someone else that's working in the repository. They were sloppy and forgot to issue push on the submodule and just pushed the containing repository. Stuff works on their machine because they made the change and those commits exist there. Go slap them and tell them to push up their submodule changes :)

Otherwise, it could be your fault if you were working on another machine and you forgot to push the submodule changes. Now you're at the other location and are thinking "What is happening! These are my changes and they should work here too!"

like image 139
Adam Dymitruk Avatar answered Sep 19 '22 04:09

Adam Dymitruk