skip to Main Content

enter image description here

I have added the files to gitignore but they keep getting pushed. Now I have even deleted this file but I keep getting this error. I’ve tried refreshing the git cache, still the error persists.

2

Answers


  1. Change the /node_modules to node_modules in your .gitignore file.
    As node_modules folder is very large file, you don’t want to push it github.

    Login or Signup to reply.
  2. There are several stages that have to be fixed, and not very easy for the begginer.

    Going from not really the right side:

    1. As Anandateertha notes, you might want to change the /node_modules to node_modules. (However this is not necessary because the meaning of / in .gitignore is different.)

    2. .gitignore does not remove the file from the repo, it applies only to file not in repo. If you added the files before, you need to remove them from the (local) repo by something like git rm <FILE_YOU_WANT_TO_LOOSE> or git rm --cached <FILE_TO_REMOVE_FROM_REPO> followed by git commit

    3. git push does not push your tree (your real files) (and does not reflect .gitignore), but it pushes the current state of your local repository.
      May be you should consider to undo one or a few local commits before doing git push again.

    Solution 1. some git reset ... + carreful git add && git commit + push again

    Solution 2. (I doubt this would work because push might push the history together with the top) git rm --cached .parcel-cache/data.mdb + git commit + git push

    Maybe start by looking at git log --stat and (of course) git status.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search