簡體   English   中英

安裝 Git LFS - master 后(預接收掛鈎被拒絕)

[英]After installing Git LFS - master (pre-receive hook declined)

我知道這個問題出現了很多,為此道歉......但我已經閱讀了 StackOverflow 上的許多條目,但我無法讓它們中的任何一個起作用。 所以又來了,希望能得到一些指導...

背景:我一個人在一個項目中工作。 我一直在 GitHub 上有我的回購,它一直運作良好。 基本上我從主人那里推拉都沒有任何問題。 這次我有一個+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 提出了正確的一種:

  1. 備份data/mbti_interim 如果它有很多版本,只需將本地存儲庫克隆到另一個路徑。
  2. 從歷史記錄中刪除data/mbti_interim ( LINK )
  3. 使用git lfs跟蹤data/mbti_interim

我沒有看到那個答案,所以我的解決方案是完全刪除 GitHub 存儲庫並開始一個沒有該文件的新存儲庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM