In our repo there is a submodule (listed in .gitmodule file). Instead of adding it with git submodule update
command, one of my teammates cloned the submodule to a different directory and added a symlink to that folder in our repo. This was being used just in their local.
But someday, it was accidentally commited (maybe because of git add --all
) and pushed to remote. When I pulled that branch to my local, the symlink got downloaded and ever since that folder is not considered as a submodule but as a file part of this repo. I did a git rm
on that file and did a commit.
But issue comes back whenever we checkout this branch. The submodule folder will staged to be deleted. Unfortunately, there have been lot of commits over this commit. So undoing the commit is tedious. What's the best course of action now?