1

I've read lots of posts already, and I've tried what I've found (ie creating my .gitignore file with the SINGLE LINE *.csv within the root directory (ie the same directory containing the .git folder (that's the root directory, right?), then running git rm -r --cached . followed by git add . followed by git commit -m "so tired of trying to ignore all csv files" followed by git push origin master. And yet, I still get many errors, all looking like:

remote: error: File zz_prep_stuff/z_csv_table_data/blah.csv is 485.89 MB; this exceeds GitHub's file size limit of 100.00 MB

So, clearly, something is wrong! Again, my .gitignore file contains only the following code:

*.csv

Please advise! Where am I going wrong? How do I ignore ALL csv files in my project? Thank you

blaughli
  • 161
  • 2
  • 3
  • 11

1 Answers1

2

And yet, I still get many errors,

But... if blah.csv has been committed to your repository in the past, it would still tracked by Git even if you add it to the .gitignore file.
The .gitignore file only ignores untracked files and does not ignore files that have already been committed to the repository.

You should use git filter-repo (to be installed first) in order to purge those .csv files from your past history (note: backup your repository first):

git filter-repo --path-glob '*.csv' --invert-paths
git push origin --force --all

It is using a Filtering based on paths.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250