Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

git push fails with "fatal: the remote end hung up unexpectedly"

Without thinking of the consequences, I added a 15.5 GB file to a repo. 

git push
said

Enumerating objects: 24, done.
Counting objects: 100% (24/24), done.
Delta compression using up to 8 threads
Compressing objects: 100% (16/16), done.
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
Writing objects: 100% (17/17), 13.93 MiB | 9.16 MiB/s, done.
Total 17 (delta 7), reused 0 (delta 0)
fatal: the remote end hung up unexpectedly
Everything up-to-date

Based on this advice I tried 

git config --global http.postBuffer 157286400

I still get

Enumerating objects: 24, done.
Counting objects: 100% (24/24), done.
Delta compression using up to 8 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), 13.93 MiB | 28.14 MiB/s, done.
Total 17 (delta 7), reused 0 (delta 0)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

I also tried removing the 15.5 GB file.

Running Bitbucket v7.11.2 in our data center.

Appreciate your advice.

Thanks

Arthur

2 answers

1 accepted

0 votes
Answer accepted

The answer is in the message from Mikael Sandberg on Jun 04, 2021.

0 votes
Mikael Sandberg Community Leader Jun 04, 2021

What command did you use when you tried to remove the file, just the regular git delete? That will just remove the file from that point on, it will not remove it from the history. In order to remove the file from history you have to do this if the you added the file in your last commit:

$ git rm --cached
$ git commit --amend -CHEAD
$ git push

This will remove the cached version, change the commit and push the changed history to you repo.

Be aware that git does have issues when the file and/or repository get above 3Gb, so it is recommended to use Git LFS if you want to store large files in your repository.

Thanks for your response Mikael. I used git rm.

Not surprisingly, I've made multiple commits now.

I don't mind using git LFS. I configured that in the Bitbucket repo. But "git push" still gets:

Enumerating objects: 44, done.
Counting objects: 100% (44/44), done.
Delta compression using up to 8 threads
Compressing objects: 100% (32/32), done.
Writing objects: 100% (34/34), 14.08 MiB | 27.78 MiB/s, done.
Total 34 (delta 17), reused 0 (delta 0)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date
Mikael Sandberg Community Leader Jun 04, 2021

Yeah, enabling Git LFS after committing large files will not help, unless you remove those files from history first. I have used BFG Repo cleaner in the past to clear out the repository from large files before moving them to Git LFS. Atlassian has a really good guide about Git LFS that you can find here.

Mikael Sandberg Community Leader Jun 04, 2021

You can also use Git filter-branch to remove the file. These are the commands for that:

$ git filter-branch --force --index-filter \
  "git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA" \
  --prune-empty --tag-name-filter cat -- --all
$ git push origin --force --all

This might be the fastest option if it is only one file you want to delete.

Thanks Mikael, as far as I can tell, that worked perfectly! And this GitHub page reassured me that your Git filter-branch approach is well-regarded.

Regards

Arthur

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

322 views 2 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you