Since my last push, my repo is above 2 GB and I followed this:
Create a temporary branch to keep any local commits.
Reset the original branch to the commit just before the bad commit containing the large files.
Push the new head to Bitbucket (rewriting history).
Restore local changes – you won’t be able to push these yet, you’ll need to remove any large files first.
I did step 1 and 2, but when I try step 3 I get:
Pushing to https://firstname.lastname@example.org/mathiagr/bitpet.git
! [rejected] Mathias -> Adding-portal-to-3D-and-AR-scene (non-fast-forward)
error: failed to push some refs to 'https://email@example.com/mathiagr/bitpet.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
How come I cannot complete step 3 with errors?
Based on the output that you attached here, it looks that you might have attempted to push without the --force flag. When you do a reset operation locally and then try to push without the --force flag, you will get an error because the remote branch contains commits that the local one doesn't (the commits you reset). In this case, it is only possible to push the branch with the --force flag.
Please keep in mind that the --force flag will force the remote branch to get your local version of the branch. If anyone else has pushed additional commits to this branch that you don't have locally, those will be lost.
I can see in our system that the repo referenced in the output is now below 2 GB, so I assume that you managed to perform the operation and reduce the repo's size?
If you'd like, I can run a git gc on the remote repo to remove any dangling commits, which may further reduce the repo's size, just let me know.
Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster ! While we’re all excited about the new improvements to Bitbucket ...
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