-1

I have two heavy files weights.bin and perf.npy, like other files to be ignored, I added the following to my gitignore file:

*.bin

*.npy

However, when I try to push them, it still appears on my github? Could you help me with that?

Community
  • 1
  • 1
Saeed
  • 598
  • 10
  • 19
  • Does this answer your question? [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Feb 26 '20 at 12:30

2 Answers2

2

You can try clear cache of git:

git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push
Ryan Nghiem
  • 2,417
  • 2
  • 18
  • 28
1

Files that are tracked by Git are not automatically removed if you add them to a .gitignore file. Git never ignores files that are already tracked, so changes in the .gitignore file only affect new files. If you want to ignore files that are already tracked you need to explicitly remove them.

git rm --cached doNotTrackFile.txt

ParagDineshGupta
  • 210
  • 2
  • 10