Resolving changes overwritten
September 17, 2021 —
~kai
So I got this error the other day when I ran git pull
:
“Your local changes to the following files would be overwritten by
merge:” because my package.json
file was outdated.
I always keep git update-index --assume-unchanged
for my
package.json
so it was frustrating that git is trying to
overwrite it. (I know I could edit the .gitignore, but there are other
developers on this project.)
Anyway, in my heart of hearts, I knew that keeping the new
package.json
is probably better, so this is what I did:
git update-index --no-assume-unchanged package.json package-lock.json
git checkout -b k-localchanges1
git add -v .
git commit -m "message" # I'm backing up my copy of package.json into my local branch
git checkout development
git pull
rm -rf node_modules/
npm install
npx expo -c
tags: code