我試圖將我的Godot副本上傳到我自己的github上,但它抱怨說:
remote error
remote: error: 檔案Godot.app/Contents/MacOS/Godot是156.41 MB;這超過了GitHub的檔案大小限制100.00 MB。
事實上,我根本不想上傳這個檔案。
我試著把它添加到.gitignore檔案中。
我試著添加各種不同的方式來輸入路徑,但都沒有成功。
檔案的結尾是:
# Scons progress indicator
.scons_node_count
# ccls cache (https://github.com/MaskRay/ccls)
.ccls-cache/
# 編譯命令 (https://clang.llvm.org/docs/JSONCompilationDatabase.html)
compile_commands.json
# Cppcheck
*.cppcheck
# https://clangd.llvm.org/ cache檔案夾
.clangd/
.cache/
# The Godot app
/Godot.app
uj5u.com熱心網友回復:
模式/Godot.app應該能很好地匹配你的檔案。 然而,如果該檔案已經被添加到版本庫中,那么.gitignore對它沒有影響。 .gitignore檔案只影響未被追蹤的檔案。
在你的例子中,你的檔案在歷史中,如果你想把它上傳到 GitHub,就需要把它從整個歷史中洗掉。 你可以做一個git rebase -i,在歷史中回到它被添加的時間點,并從歷史中洗掉它,或者,如果它是在最近的提交中添加的,你可以用git rm -r Godot.app洗掉它,然后運行git commit --amend。
你也可以使用git filter-branch或者git filter-repo來從歷史中過濾掉它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/317548.html
標籤:
