git - 安装 Git LFS - master 后(预接收挂钩被拒绝)
问题描述
我知道这个问题出现了很多,为此道歉......但我已经阅读了 StackOverflow 上的许多条目,但我无法让它们中的任何一个起作用。所以又来了,希望能得到一些指导...
背景:我一个人在一个项目中工作。我一直在 GitHub 上有我的 repo,它一直运行良好。基本上我从主人那里推拉都没有任何问题。这次我有一个 +173MB 的大文件,所以我决定尝试总是弹出的 Git 大文件存储。我遵循的过程是它在网站上所说的:
brew install git-lfs
git lfs install
git lfs track "*.csv" (my file is a csv)
git add .gitattributes
这样做之后,我无法再推送给主人了。消息是:
(venv-MBTI) (base) diego@DIGL Capstone 2 - MBTI % git push origin master
Uploading LFS objects: 100% (1/1), 345 B | 0 B/s, done.
Enumerating objects: 146, done.
Counting objects: 100% (135/135), done.
Delta compression using up to 4 threads
Compressing objects: 100% (116/116), done.
Writing objects: 100% (120/120), 59.90 MiB | 634.00 KiB/s, done.
Total 120 (delta 25), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (25/25), completed with 7 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: cb2e700c19f2bdbb2ca9aeb2df53605a
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data/mbti_interim is 173.20 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/DSJourney/MBTI.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/DSJourney/MBTI.git'
我尝试了在 StackOverflow 中找到的大部分内容:
git pull --rebase
git reset --soft HEAD~1
git revert a2f2db2 (an older commit)
git push -u origin master
我也试着跟随
其他不太相关的东西
我想我做错了什么,但一直无法弄清楚。
有什么建议吗?
解决方案
提出了两种解决方案,ElpieKay 提出了正确的一种:
- 备份
data/mbti_interim
。如果它有很多版本,只需将本地存储库克隆到另一个路径。 data/mbti_interim
从历史记录中删除(链接)- 用于
git lfs
跟踪data/mbti_interim
我没有看到那个答案,所以我的解决方案是完全删除 GitHub 存储库并开始一个没有该文件的新存储库。
推荐阅读
- python - 包括的使用
- php - PHP 将数组中的结果捕获到变量中 - 变量必须同时包含匹配项和数组中的对应行
- logging - Grok 过滤器/模式以提取常见和必需的属性,而与日志中的顺序无关
- reactjs - 使用 Material UI/React JS 在另一个组件中显示选定的行数据
- sql - 在 WHERE 子句中将 nvarchar 转换为 bigint 时出错,但在 SELECT 中有效
- python - 传递 sklearn 管道中的所有列
- unit-testing - 使用 kotlin mockito 对 catch 块进行单元测试
- filter - 每个 id 对相同值求和一次
- angular - Angular *ngFor 循环 - 类型“OrderItem”不可分配给类型“Iterable”
' - python - json.dumps() 无法转换此字典字符串