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.
There are several stages that have to be fixed, and not very easy for the begginer.
Going from not really the right side:
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.)
.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
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.
2
Answers
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.
There are several stages that have to be fixed, and not very easy for the begginer.
Going from not really the right side:
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.).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 likegit rm <FILE_YOU_WANT_TO_LOOSE>
orgit rm --cached <FILE_TO_REMOVE_FROM_REPO>
followed bygit commit
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 againSolution 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
.