大きすぎるファイルをアップロードすると、GitHub がエラーを報告します: リモート: エラー: GH001: 大きなファイルが検出されました。

1. どのファイルが大きすぎるかを確認します

remote: Resolving deltas: 100% (24/24), completed with 3 local objects.
remote: warning: File CPT_0707_ao/temp_past/temp2/deltap.csv is 71.69 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: c42ade10239deffc45c2a2800135e242
remote: error: See http://git.io/iEPt8g for more information.
To https://github.com/******
 ! [remote rejected] master -> master (pre-receive hook declined)

CPT_0707_ao/temp_past/temp2/deltap.csv ファイルが大きすぎて、50MB の制限を超えていることがわかります。次に、処理する必要があるのはこのファイルです。

2.コミットを書き換えて大きなファイルを削除する

git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch CPT_0707_ao/temp_past/temp2/deltap.csv' --prune-empty --tag-name-filter cat -- --all

3. 変更したリポジトリをプッシュします

git push origin master

4. クリーンアップしてスペースを再利用する

上記のファイルは削除しましたが、これらのオブジェクトはまだリポジトリに保持され、ガベージ コレクション (GC) を待っているため、コマンドを使用してファイルを完全にクリアし、スペースを再利用する必要があります。

rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now

完全に解決する

おすすめ

転載: blog.csdn.net/frighting_ing/article/details/129223638
おすすめ