Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I canno't remove a file with git rm neither directly on bitbucket web site. how can i remove it?

JulieCardin75 January 25, 2019

I have upload a file that is too big for bitbucket.

It was a mistake of me.

bitbucket is for scripts not a big DB.

I have tried to do my steps:

git rm --cached <myTooBigFile>

git commit -am "This was too Big and it it not script,"

git push

Everithing have been accepted but when i try do make some other modification on other files, it refuse and mentionned that I am taking too much space... 

I also tried directly on the web site

I went to the remote repository's website > Source > select branch > select folder > select file to be deleted > Edit > Delete > Commit.

But it didn't work.

and this also didn't work;

https://stackoverflow.com/questions/6313126/how-to-remove-a-directory-from-git-repository/6313301#6313301

any suggestion to remove this too big file that blocs everything else , please?

Thank you very much

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2019

Hi Julie, welcome to the Community!

You've removed it from your current version, but that file is still available in the previous versions of your repo. You'll need to make sure that file is not in any commit. There are different ways to achieve that: 

  • If the file was added recently, you can reset back as many commits as necessary to a moment before the file was there. The instructions are explained at Reduce repository size.
  • You can rewrite Git revision history by rewriting certain branches, for more info you can read Git filter branch.
  • You can create a new repository making sure the big file is not there with the rest of your code, however, this will means your previous history will be lost.

Hope that helps!

Ana

JulieCardin75 January 28, 2019

Hi, I did the instructions in : Reduce repository size. It still do not accept to push even : git push --force. It still says 

repository is in read only mode (over 2 GB size limit). Learn how to reduce your repository size: https://confluence.atlassian.com/x/xgMvEw.
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.

And I have also done:

git rm -f ...  ;

git filter-branch --tree-filter -f 'myTooBigFile' HEAD

-> reduce your repository size: https://confluence.atlassian.com/x/xgMvEw.

; Still says 

repository is in read only mode (over 2 GB size limit). Learn how to reduce your repository size: https://confluence.atlassian.com/x/xgMvEw.
fatal: Could not read from remote repository. Please make sure you have the correct access rights...

Sounds like that the perception is that is is too big too add something, even wht I am trying to do is to rm ...

Any suggestion please?

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2019

Hi Julie, regarding your last message sounds like you were using a wrong account or maybe some wrong credentials because you got the error message "fatal: Could not read from remote repository. Please make sure you have the correct access rights..."

I've checked the repo again and I could see is bigger than 5GB now, I've run a gc on the remote but the size hasn't changed, which means your file is still that size. Can you run the following on your terminal and let us know the output? This will show the current size of your repo:

git count-objects -Hv

This will repack your files in a more efficient manner:

git repack -A -d

And this will show the size of the new repacked repo:

git count-objects -Hv

 

Additionally, you can you try cloning it locally and see what size it is. If the size differs from what we have in the remote, it means there must be some additional references and garbage that have been generated during the operations and that we'll need to remove.

Let us know!

Ana

JulieCardin75 January 29, 2019

git count-objects -Hv
-->> Answer: size-pack: 5.12 GiB

>>> git repack -A -d
>>> git count-objects -Hv
-->> Answer:  size-pack: 5.33 GiB

-----

I have also tried :

https://stackoverflow.com/questions/24472596/git-fatal-pathspec-is-in-submodule
Removing the directory from git and adding it again. 

git rm --cached directory
git add directory

But when try to :

git rm -r fichier
git commit -m "a"
git push

-->> Answer still: 

Repository is in read only mode (over 2 GB size limit).
remote:
remote: Learn how to reduce your repository size... -->> Which I already tried. 

 

Any other suggestion ? 

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events