gpt4 book ai didi

Github-文件XYZ为126.80 MB;这超出了GitHub的文件大小限制100.00 MB

转载 作者:行者123 更新时间:2023-12-04 05:48:25 28 4
gpt4 key购买 nike

我有一个本地存储库,有一个大文件被意外添加到其中。现在,即时通讯几乎落后了100次提交。当我尝试推送到GitHub时,它给了我一个错误。

我需要做任何我需要做的事情,以便能够推送此存储库的其余部分。

我不需要此文件,可以将其永久删除

(侧面注意:这是一个包含IPython节点和代码的目录。我有一个脚本自动推送该脚本,这就是为什么我落后了将近100次提交。我只是注意到它未同步)

这是我尝试未成功的尝试:

git status

On branch master Your branch is ahead of 'origin/master' by 100 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean


git filter-branch --index-filter 'git rm --cached --ignore-unmatch "Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt"' --tag-name-filter cat -- --all

Rewrite d381c7d5037a6a26abb2b5cef06e57d8b86a398b (95/189)rm 'Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt'
..
Rewrite f639b57714a5d57ff37b9d4a55c1c69fc0b514a8 (176/189)rm 'Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt'
Rewrite 587c8b65f19315ebeb6627a75bd703a5dbdec208 (189/189)

Ref 'refs/heads/master' was rewritten
WARNING: Ref 'refs/remotes/origin/master' is unchanged


git rm "Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt"

fatal: pathspec 'Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt' did not match any files


git push

warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 841, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (578/578), done.
Writing objects: 100% (835/835), 31.79 MiB | 3.14 MiB/s, done.
Total 835 (delta 196), reused 0 (delta 0)

remote: warning: File .git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt is 74.92 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File .git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt is 69.38 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB

remote: error: GH001: Large files detected.
remote: error: Trace: f013f5e75b4f35d07de5d2d9ef1116bd
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File .git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt is 126.80 MB; this exceeds GitHub's file size limit of 100.00 MB

To git@github.com:rbohac/IPython-Notebooks.git ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:rbohac/IPython-Notebooks.git'

最佳答案

确保您的最新提交是正确的,因为BFG会假设这一点,并在重新编写和清除Git历史记录时使用您的最新提交来维护您的仓库状态。 BFG与'git-filter-branch'类似,但它是为更特定的目的而编写的实用程序,而git实用程序功能更广泛,功能更多,但牺牲了运行效率较低的缺点。当我从该来源获得所有这些信息时,请阅读有关BFG的文档以获取更多详细信息。

brew install bfg
bfg --strip-blobs-bigger-than 50M
git rm --cached XYZ
git commit --amend -CHEAD
git push

BFG将更新您的提交以及所有分支和标记,以使它们保持整洁,但实际上不会删除任何内容。检查存储库以确保一切正确,然后清除缓存并运行'git gc'清除Git现在将识别的有害数据,因为该数据已从历史记录中删除。

更多:
  • https://help.github.com/articles/removing-files-from-a-repository-s-history/
  • https://rtyley.github.io/bfg-repo-cleaner/#usage
  • 关于Github-文件XYZ为126.80 MB;这超出了GitHub的文件大小限制100.00 MB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31349508/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com