2

I am using EC2 box with 4GB RAM and disk space of 8GB. I inspected my directories all of which were supposed to contain python scripts. I found that my /.git folder is 1.8GB in size. Most of the space was taken by ./.git/objects folder. Out of that too very few folders are in ~200MBs.Is it too much of a size? Can I just delete those folders? I am running out of disk space so cannot install more packages using pip.

I am 40 commits ahead on EC2. I don't want to push those commits because there is something in the history which is huge in size(some 100MB which I unknowingly committed) and it does not allow me to do so. I looked at the solution online and found that it is not so easy. Given the amount of time that I have I decided to edit scripts on my local machine and push those to git and then pull them into my remote machine.

pg2455
  • 5,039
  • 14
  • 51
  • 78
  • That is the actual data `git` uses to track revisions; you can't delete them. You may want to research how to purge the 100MB file from Git's history. – chepner Jul 31 '14 at 16:05

1 Answers1

3

You should take a look at this thread to find out what happened (possible duplicate): How to find/identify large files/commits in Git history?

Then take a look at BFG Repo Cleaner to clean up your repository.

You should avoid commiting binary files because even deleted, they will always be in the .git/objects folder, and you should never delete files from there yourself.

Community
  • 1
  • 1
fpietka
  • 1,027
  • 1
  • 10
  • 23