1

I accidentally commited/pushed large folders to github and am unable to push further. When trying to commit and push I receive the following message. "batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access." I would like to remove the .next folder. and I do not want to purchase more storage. I am using git bash and windows 10.

Attempts I have tried so far.

  1. Adding to .gitignore file and pushing.

  2. Following the example and solution provided here

    git filter-branch --tree-filter "rm -rf .next" --prune-empty HEAD git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d echo .next/ >> .gitignore git add .gitignore git commit -m 'Removing .next from git history' git gc git push origin master --force

  3. The solution provided Here

    git rm -r --cached myFolder

  4. The solution provided here

*CD to your local working folder and run the following command:

git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all
replace FOLDERNAME with the file or folder you wish to remove from the given git repository.
Once this is done run the following commands to clean up the local repository:
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
Now push all the changes to the remote repository:
git push --all --force

This will clean up the remote repository.*

My repository is linked below.

https://github.com/Rinzler8806/crowdCoin

I appreciate your help!

Shane
  • 105
  • 1
  • 2
  • 10

0 Answers0