2017-06-03 76 views
0

我嘗試發佈,這超過100MBGIT錯誤 - 這超過了GitHubs文件大小限制 - 但該文件已被刪除

然後我看着它,實現GitHub上有一個限制的文件。

雖然它看起來像我可以進行更改使用較大的文件Git lfs - "this exceeds GitHub's file size limit of 100.00 MB"這不是我的目標。相反,我編輯的文件,現在下80MB左右

的問題是,當我嘗試git pull(或同步使用Web應用程序),我仍然可以說這個文件是太大了......

我是隻能猜測git已經得到了不再存在的東西的句柄,但我不知道如何從試圖上傳這個文件中刪除它。

這是我的努力,它也顯示失敗(第一行)。這是從Git的外殼

remote: error: File Photoshop/Originals/homePage.psd is 119.97 MB; this exceeds GitHub's file size limit of 100.00 MB 
To https://github.com/company/site.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://github.com/company/site.git' 
G:\websites\GitHub\site\Website\site[master ↑3 +0 ~1 -0 !]> git rm --cached Photoshop/Originals/homePage.psd 
fatal: pathspec 'Photoshop/Originals/homePage.psd' did not match any files 
G:\websites\GitHub\site\Website\site [master ↑3 +0 ~1 -0 !]> git rm Photoshop/Originals/homePage.psd 
fatal: pathspec 'Photoshop/Originals/homePage.psd' did not match any files 
G:\websites\GitHub\site\Website\site [master ↑3 +0 ~1 -0 !]> 
+0

也許文件仍然是存儲庫的一部分。從一個提交中刪除它並不意味着它在早期提交中不存在。過濾分支在這裏可能會有幫助。 –

+0

'git filter-branch'剛剛返回'不能重寫分支:你有未分離的變化' – MyDaftQuestions

+0

不要盲目地運行過濾分支。找出該文件正在發生什麼,然後從那裏開始。不是我的downvote。 –

回答

1

嘗試複製和使用BFG Repo-Cleaner,但要確保當前的工作樹有沒有進行中的變化(添加並提交第一)

cd /path/to/your/local/repo 
java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git 
git reflog expire --expire=now --all && git gc --prune=now --aggressive 

然後推新的歷史(強行推送覆蓋:確保你是唯一一個處理該回購的人,或者進行溝通你的重寫)

git push --force 
+0

我首先看到:'掃描大文件包的包文件:702. 掃描大文件包的文件包文件在397毫秒內完成。 警告:在包文件中找不到大塊匹配標準 - 需要打包回購嗎?' – MyDaftQuestions

+0

當我運行行開始'git reflog expire'時,出現此錯誤:'令牌'&&'不是有效的語句分隔符在這個版本中' – MyDaftQuestions

+0

@MyDaftQuestions這是一個bash會話的語法。如果你在Windows上運行它,你可以先輸入bash。 – VonC

相關問題