git push --force fail

479 Views Asked by At

I had recently did some clean up of my repo as it had some large files in the history. I had use BFG to clean up, did the necessary steps as mentioned here here. At the final steps when doing the git push to publish the updated changes, it fails. Error Message:

$ git push --force
Enumerating objects: 4767, done.
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
error: failed to push some refs to 'https://my/personal/repo.git'

Some additional info:

  1. I did the clean up in a not bare repo
  2. I currently had trouble pulling the repo as it is over 2G already hence wanted to clean up some image files that I accidently push up to the remote repo.
  3. There are several other people using the repo and I would like to do the clean up in a way that minimize disruption to their work.
  4. Currently, all of us are pulling the lastest commit and working from there by this command:

    git clone -b dev https://my/personal/repo.git --depth=1

1

There are 1 best solutions below

1
On

My guess is that this is not specific to the branch you're pushing.

fatal: the remote end hung up unexpectedly is more connectivity or authentication type of issue.

Do you have a non cleaned up version of the repo? You could try to push there to confirm the setup is correct.