I have committed and pushed a too large file in bitbucket, and I’ve deleted it locally, committed and pushed again. But on the site bitbucket the size of the repository is still too large.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sounds like you created a new commit where you deleted the file. That means the file still exists in the previous commit.
What you need to do is rewriting history. Assuming the two newest commits are deleting and adding that file, you can do the following:
This will remove the two newest commits and then forcefully push it to bitbucket. In case that doesn’t help reducing the site you need to contact bitbucket support so they can run
git gcon your remote repository to actually get rid of the deleted commits/files.If you only want to remove the given file without nuking the whole commit, you can do it using
git-filter-branchas explained in the GitHub docs (it’s not GH-specific):Obviously you need to replace
THE_FILEwith the name of the file you want to obliterate. After this you also need to perform a forced push.