0

I'm having some problems making git ignore some undesired files in the push operation to github. First I actually added and committed all files without realizing. Then I created a .gitignore file with the name of the two folders to be ignored. After that I did:

git rm -r --cached data/ __pycache__/

This is then proceeded with

git add *.py
git commit -m "Some message"

However, when I execute

git push origin master

It still tries to send all the contents of the folders data and __pycache__ to the remote directory. How can I stop this and send only the files that I want?

P.S. after the execution of git rm I checked the exclusion of the folders with git check-ignore and it returned the address of both folders (with means that they are set to be ignored)

EDIT: output of push operation

Counting objects: 100% (176/176), done.
Delta compression using up to 16 threads
Compressing objects: 100% (175/175), done.
Writing objects: 100% (176/176), 296.34 MiB | 3.41 MiB/s, done.
Total 176 (delta 39), reused 0 (delta 0)
remote: Resolving deltas: 100% (39/39), done.
remote: warning: File data/19_tracks.csv is 60.92 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File data/20_tracks.csv is 78.82 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File data/21_tracks.csv is 98.73 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File data/23_tracks.csv is 97.17 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File data/18_tracks.csv is 77.63 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File data/22_tracks.csv is 93.44 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File data/24_tracks.csv is 71.87 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File data/25_tracks.csv is 83.31 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: 2e79af1426db09c9e46bd6a57e808168a1bb8b3fccfdc89463bf7d91da27de72
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data/26_tracks.csv is 109.91 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data/27_tracks.csv is 131.58 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data/28_tracks.csv is 116.37 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data/29_tracks.csv is 129.68 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/nelsondmmg/ImageLabeller.git
 ! [remote rejected] master -> master (pre-receive hook declined)
Nelson
  • 67
  • 5
  • Can you explain in more details what indicates that git uploads your `__pycache__` directory when you run `git push` ? – LeGEC Jan 18 '22 at 16:53
  • I edited the question to display the output log of the push operation. – Nelson Jan 18 '22 at 16:59
  • 2
    The large files are still in the commit you made previously. You need to amend that commit. – matt Jan 18 '22 at 18:06

0 Answers0