Your local changes to the following files would be overwritten by merge -How do I resolve git saying please commit your changes or stash them before you merge?
You can't alter the nearby changes. Since git protects from losing significant changes for that we have 3 alternatives:
Option 1: Commit the changes using
git commit -m” custom message”
Option 2: Stash it
Stash can act like a sack. Where you can push changes and pop them in reverse order use the following commands.
git stash
And do a merge and pull the stash
git stash pop
Option 3: Discard the local changes
using
git reset --hard
or
git checkout -t -f remote/branch
Or:
Discard local changes for a specific file
using
git checkout filename
Also, these git commands will surely help you if you are regularly working with git.