How do I resolve git saying “Commit your changes or stash them before you can merge”?
I was checking how I could resolve an issue with git that did not deploy my application because local files had some changes.
So I found a couple of options to be able to pull and deploy my platform.
Commit the change using
git commit -m "My message"
Stash it.
Stashing acts as a stack, where you can push changes, and you pop them in reverse order. To stash, type
git stash
Do the merge, and then pull the stash:
git stash pop
Discard the local change using
git reset --hard
or git checkout -t -f remote/branch
Or: Discard local changes for a specific file using
git checkout filename