目前我有

空的GitHub回购 SSH服务器恢复(main) 当地的回购

SSH服务器回购是最新的回购(生产站点),所以我从那里克隆了一个Git到本地。然后我尝试做一个git推送到GitHub。

一切都很好,但随后它说一些关于文件名。gz对GitHub太大。我不需要这个文件,所以我运行了几个Git命令从Git缓存中删除它,然后推回到SSH服务器。

我没有看到本地的大文件,但它仍然在SSH服务器上,即使git diff返回什么,git推送返回“一切都是最新的”-即使文件在本地回购中不可见,当我尝试推送到GitHub时,我仍然会得到错误

文件fpss.tar.gz是135.17 MB;这超过了GitHub的文件大小限制100mb

我遵循了“修复问题”列在GitHub帮助下的步骤,所以这不应该已经足够了吗?

当它不在本地或在git status/diff/push中列出时,文件如何仍然在以太中?


当前回答

我也有同样的问题。

为了解决这个问题,我取消了提交。然后,我分别重新提交每个文件。

其他回答

我尝试了以上所有的方法,但没有一个对我有效。

然后我想出了自己的解决办法。

First of all, you need a clean, up-to-date local repo. Delete all the large files. Now create a new folder OUTSIDE of your repo folder and use "Git create repository here" to make it a new Git repository, let's call it new_local_repo. This is it! All above methods said you have to clean the history..., well, I'm sick of that, let's create a new repo which has no history at all! Copy the files from your old, messed up local repo to the new, beautiful repo. Note that the green logo on the folder icon will disappear, this is promising because this is a new repo! Commit to the local branch and then push to remote new branch. Let's call it new_remote_branch. If you don't know how to push from a new local repo, Google it. Congrats! You have pushed your clean, up-to-date code to GitHub. If you don't need the remote master branch anymore, you can make your new_remote_branch as new master branch. If you don't know how to do it, Google it. Last step, it's time to delete the messed up old local repo. In the future you only use the new_local_repo.

当我的iOS项目没有gitignore文件时,我就遇到了这个问题

我想它可能是想把一个巨大的文件推送到github而github可能拒绝了这个巨大的文件或(多个文件)

对我有用的是:

重命名我的GitHub项目文件夹到其他东西 用正确的文件夹名称重新克隆repo 删除我重命名的repo中的.git文件夹(可能必须打开允许查看Windows中的隐藏文件) 将.git文件夹从正确的文件夹名移动到已重命名的文件夹名 删除重新克隆的repo文件夹,将原repo文件夹重命名为正确的名称 提交您的更改(没有大文件)并推送

如果你上传的是你自己的项目,那么只要去目录所在的文件。 删除大文件。 然后点击“view”(窗口文件) 查看->检查隐藏文件夹 然后你就能看到了。”git的文件 删除.git文件 这将删除所有提交历史记录 然后你可以像新的一样推动你的回购…

git lfs migrate import --include="fpss.tar.gz"

这应该用新的LFS引用重写您的本地提交

https://github.com/git-lfs/git-lfs/blob/master/docs/man/git-lfs-migrate.1.ronn?utm_source=gitlfs_site&utm_medium=doc_man_migrate_link&utm_campaign=gitlfs#examples