30

H! I installed LFS in my github repository to track my *.csv files but when someone else tried to upload other csv and I wanted to make the pull of my repository this was the result

This repository is over its data quota. Account responsible for
LFS bandwidth should purchase more data packs to restore access.

My question is How can I recover the access to my repository, it doesn´t matter if I can not use anymore LFS I will move my csv files to other place, I just want to recover the access to my github repository and being able to push and pull.

LightCC
  • 9,804
  • 5
  • 52
  • 92
coding
  • 917
  • 2
  • 12
  • 25
  • 1
    See [Managing billing for Git Large File Storage](https://docs.github.com/en/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-git-large-file-storage). – Schwern Jul 14 '20 at 23:17
  • 1
    Yes I know that I exceeded the bandwidth and the storage but I don't want to buy more storage. I want to know how can I have access again to my repo removing LFS or something like this. – coding Jul 14 '20 at 23:24

7 Answers7

37

I'll explain what I did...I tried to clone a repository from GitHub which contains GIT LFS pointers in it. I followed the following steps and got the actual files.

  1. Fork the repo to one of your users
  2. Go to repo settings
  3. Find "Include Git LFS objects in archives" under the Archives section and check it
  4. Go to the Danger Zone section, select "Archive this repository"
  5. Confirm and authorize.
  6. Return to the archived repository. 7 .Download as .zip
  7. Download will pause for a minute or so before it starts downloading lfs objects. Wait and it should continue.
Kirushikesh
  • 578
  • 5
  • 8
34
  1. Go to your repo settings.
  2. Scroll down to the archives section.
  3. Check on the checkbox of Include Git LFS objects in archives.
  4. Then try to push from locally again.
Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
9

I'd need more info to fully understand the current situation, such as the current size of the repo, how many times you've pushed, how many other colloborators are working in the same repo, but here are several possible courses of action:

  1. If you don't have any collaborators (you are the only user), it's quite possible that you have a full copy of the repo locally. Are all the files intact locally?
  2. Wait until next month, when you get another 1 Gb+ of free bandwidth, download the repo first thing, then change your settings.
  3. It may be possible to download the latest commit as a zip file directly on the Github website if only command line access has been limited, not sure if this option is available with LFS.
  4. Pay to get it unlocked
  5. Check the options to see if Git-LFS can be disabled remotely (I don't think this is possible)

Once you can get the full repo cloned locally, you can turn off Git-LFS, make a commit, and either push back up to the current repo, or push up to a new repo (either at Github or a different hosting site). I'm not 100% sure if disabling Git-LFS in the config locally will also disable it fully on Github for the remote repo.

LightCC
  • 9,804
  • 5
  • 52
  • 92
6

I was able to get past this issue by only executing no. 2 and no. 3 from the previous answer. 2. Go to repo settings 3. Find "Include Git LFS objects in archives" under the Archives section and check it

I then tried to push again and succeded

user18644787
  • 61
  • 1
  • 1
  • 3
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 31 '22 at 15:53
1

Can't find "Include Git LFS objects in archives" under the Archives section. enter image description here

So all the previous answers are not correct. The applicable answer is as below:

  • commit & push everything
  • create a branch, something like fix/remove-lfs
  • remove hooks git lfs uninstall
  • remove lfs stuff from .gitattributes (open file, delete content - don't delete the file!)
  • list all lfs files, git lfs ls-files
  • run git rm --cached for each file
    • if your list is big, copy the contents into a file.txt
    • make sure you remove the number and asterik on each line, you only want the paths to the files
    • while read line; do git rm --cached "$line"; done < files.txt
  • run git add for each file
    • if you have a file.txt
    • while read line; do git add "$line"; done < files.txt
  • run a git status and make sure all the files were added properly
  • commit everything
git add .gitattributes
git commit -m "unlfs"
git push
  • check that no lfs files left with git lfs ls-files
  • remove any lfs, rm -rf .git/lfs

Once your branch (fix/remove-lfs) is merged into develop, your team doesn't need to do anything other than simply pulling and checking out the new state of the world, their repository will work as-expected without git lfs installed. If git lfs is still installed, simply let them uninstall it: git lfs uninstall

Credits: Fedor, Taylor, Chase, Simon

Refer from: https://gist.github.com/everttrollip/198ed9a09bba45d2663ccac99e662201

hustnzj
  • 525
  • 6
  • 13
  • It's definitely still there for me? Are you sure you're checking the repo settings and not your account settings? – Hashim Aziz Mar 07 '23 at 00:17
0
Wait for next month or you can just install your local Git server.


For Windows

[https://dl.gitea.io/gitea/1.13.0/gitea-1.13.0-windows-4.0-386.exe][1]
[https://dl.gitea.io/gitea/1.13.0/gitea-1.13.0-windows-4.0-amd64.exe][2]
[https://bonobogitserver.com/][3]    *- deploy on IIS if you do not like Apache*
[https://gitstack.com/download/][4]  *- limit developer users, not recommended* 

*For Linux -> Git lab is the best for local* 
[https://dl.gitea.io/gitea/1.13.0][5]   -  Linux and Windows version too
[docker pull store/gitlab/gitlab-ce:11.10.4-ce.0][1]   - Docker image install community edition 

https://hub.docker.com/editions/community/docker-ce-desktop-windows/ - docker for Windows

  [1]: https://dl.gitea.io/gitea/1.13.0/gitea-1.13.0-windows-4.0-386.exe
  [2]: https://dl.gitea.io/gitea/1.13.0/gitea-1.13.0-windows-4.0-amd64.exe
  [3]: https://bonobogitserver.com/
  [4]: https://gitstack.com/download/
  [5]: https://dl.gitea.io/gitea/1.13.0
Pit
  • 395
  • 2
  • 11
-5

Get a gitlab account. Use that until your account unfreezes -- maybe longer.

Micheal Bee
  • 550
  • 5
  • 11