user561638
user561638

Reputation: 1367

Git submodules reference is not a tree

A developer here ran the steps we recommend for git usage, and has lost a submodule commit. I understand that this error means that she pushed in the super project but not in the submodule, but she denies this and has a history of her commands that she showed me. Here are the steps that seemed to have caused this. I would like to understand how to tell her to avoid this in the future.

At this point, her work committed in the original commit in the submodule disappeared from git log.

Upvotes: 0

Views: 1295

Answers (1)

CharlesB
CharlesB

Reputation: 90496

I suppose the commit was lost when she solved the submodule conflict. It can be retrieved by following instructions in this question.

Or run

gitk --all $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

(This is from this question)

Only do it on the original repo (as git clone will delete dangling commits), and make a backup of it before.

Upvotes: 1

Related Questions