【问题标题】:Push data from git to github. file too big but can't file the file in repository将数据从 git 推送到 github。文件太大但无法将文件归档到存储库中
【发布时间】:2018-07-09 06:14:42
【问题描述】:

Error when I push to github

我正在尝试在 Github 中推送我的代码,但我遇到了问题。它说有大于100mo的文件并且无法上传。但是,我从本地存储库中删除了这个文件和文件夹。

它说文件夹导入的文件太大。但是,这个文件夹在我的仓库中已经不存在了。

有人知道如何在 git 中删除一个我再也看不到的文件夹吗?

【问题讨论】:

标签: git github push


【解决方案1】:

之前的一些提交可能仍然引用了该文件。

您应该运行git filter-branch - 请参阅https://help.github.com/articles/removing-sensitive-data-from-a-repository/#using-filter-branch

这可能与 Completely remove file from all Git repository commit history 重复

【讨论】:

    【解决方案2】:

    正如docs 所说,从本地存储库中删除文件的最简单方法是从磁盘中删除文件,然后记录删除:

    git status
    git add filename
    git commit -m "removed filename"
    

    也相关Delete deleted files/folder when updating a git repo

    【讨论】:

    • 感谢您的回答,问题是该文件夹已不在磁盘上,但似乎仍在我的本地仓库中
    • 然后只需通过添加和提交来记录更改,即删除文件。当您执行git status 时,此更改应该可见。
    猜你喜欢
    • 2011-12-09
    • 2021-09-11
    • 2021-09-09
    • 2017-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-27
    相关资源
    最近更新 更多