I have a submodule which I changed some local files. The original repository has been modified and I now wish to do a pull on the submodule, but I get an error saying that I will lose my changes.
How do I force git to ignore local changes and do the pull?
I know there are lot’s of similar questions to this, but I couldn’t find a question in stack overflow that answered my particular problem (specifically submodules).
git reset --harddoes exactly that – discard all changes and return toHEAD.Or you can use
git stashand after pull –git stash applyto restore your changes over updated tree.If a submodule contains another submodules, it can be done recursively