Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git freezing at push while compressing objects

hi I'm using Github to push some files from my local server to my Github repository. I accidentally included a 500Mb video file in the commit and I think this totally screwed up the add/commit/push.

Specifically, my command stalls at the push like this:

git push -u myGithubRepository master
Counting objects: 52, done.
Delta compression using up to 4 threads.
Compressing objects:  97% (36/37) 

It's been many hours and is still stuck.

I'd like to commit all the other changes I made so I don't want to revert back to what's on my Github repository. I just want to resolve this conflict. I'm a Git novice so please take it easy on me.

thanks, tim

like image 518
tim peterson Avatar asked Aug 31 '26 14:08

tim peterson


2 Answers

@torek was correct, "It's not actually frozen, it's just going to take a very long time to compress that giant object."

like image 171
tim peterson Avatar answered Sep 02 '26 06:09

tim peterson


Is there some reason you must include the file in your repo? I would recommend you can take out the 500mb file of your repo, and store it somewhere else.

  1. Stop the process (^C)
  2. Remove the file, either by placing it in your .gitignore file or moving it out of the project completely.
    • If you do decide to place it in your .gitignore file, you will have to delete the cache of the file from your repository: git rm --cached <file>. Otherwise, it will still appear in the project. Note: This will not remove the file at all, but just the repository's reference to it. The file will still be sitting in the directory after all is said and done.
  3. Commit
  4. Push
  5. Happiness

Good luck :)

like image 25
sparrow Avatar answered Sep 02 '26 05:09

sparrow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!