Read the statement by Michael Teeuw here.
unable to git pull successfully
-
@1a2a3a said in unable to git pull successfully:
error: Your local changes to the following files would be overwritten by merge:
package-lock.jsonthis file is regenerated by npm install, so just erase it
rm package-lock.json
but… these make no sense
error: The following untracked working tree files would be overwritten by merge: .vscode/settings.json types/google-photos.d.ts types/type.d.ts Please move or remove them before you merge.
as they are untracked, git doesn’t do anything with them…
but I see search results for that problem…
looks like you were developing in the module folder… so
you SHOULD be able to stash those files (hide them)
one suggestion (afer erasing the package-lock.json)git add * git stash git pull
after the pull,
git stash pop
-
@sdetweil did as per your mentioned but still stuck with .vscode/setting.json
-
@1a2a3a If you want to reset the module without saving your local changes, you can do this in the module’s directory:
git fetch origin master git reset --hard origin/master git pull
-
@KristjanESPERANTO thanks, that fixed it now!
-
@KristjanESPERANTO but why does this fix the problem of untracked files blocking pull? if they are untracked, they are not in the repo… I have never seen this happen
-
@sdetweil With
git reset ...
everything is reset hard, this fixes the problem, but does not help to explain it. I haven’t fully understood myself whygit pull
didn’t worked aftergit stash
.