git2zip producing large output?

git2zip producing large output?

by Christian DiMaria -
Number of replies: 2

For some reason when I used git2zip on my assignment 10 repo, the resulting zip file is ~800 MB, so I can't upload it to the course website. I don't know why it's this large. I accidentally added a couple ".dat" files to the repo in an earlier commit, but I deleted them from the repo using "git rm" so they are no longer there.

Not quite sure what to do so for now I'm just leaving a comment with the location of my repo in the assignment submission.

In reply to Christian DiMaria

Re: git2zip producing large output?

by Ramses van Zon -

Git keeps old commits around "just in case".  Be carefull with and avoid commands like "git *" or "git .", instead, be specific on what you want to add. 

To decrease the size of the repo, you can ask git to do 'garbage collection' on objects that it does not need anymore with the command 'git gc --prune=now'.  However, if that file is still somewhere in a past commit, that would not work, as git needs to keep a copy in the repo, so you'd have to look at tools to rewrite the git history, such as "git-filter-repo". 

In reply to Ramses van Zon

Re: git2zip producing large output?

by Christian DiMaria -
Thanks, that makes sense. I'll see if I can get it down to a smaller size.
 
Update: Using 'git gc --prune=now' worked, the zip file is much smaller now and seems to contain everything I need.