git - 无法在 git 尝试推送未跟踪目录的情况下更改 git(企业)远程 url
问题描述
我需要托管在 GitLab 上的存储库也托管在 GitHub Enterprise 服务器上。服务器阻止上传超过 100MB 的文件。
我有一个本地 Mongo 数据库,其中包含两个“prealloc”文件,每个文件留出 1GB。我删除了父 (data/) 目录(现在使用 MLab 来托管数据库),并使用git rm data/
. 然后我做
git remote set-url origin git@my-enterprise.github.git
这会将原始 url 设置为企业版本。然后,当我尝试推送时,它会中止推送以及消息:
remote: error: File data/journal/prealloc.0 is 1024.00 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB
即使目录已经消失。它不在 git 的跟踪文件列表中。关于我可能遗漏的任何想法?
解决方案
即使目录已经消失。它不在 git 的跟踪文件列表中。关于我可能遗漏的任何想法?
- 首先,你的历史中仍然有它。
- 其次,验证它是否已被删除:
git rm -rf --cached data/
这会将其从暂存中删除,您必须提交删除。 - 3rd 使用 BFG 工具清理你的 repo https://rtyley.github.io/bfg-repo-cleaner/
推荐阅读
- java - 在多线程环境中用 C# 和 Java 编写时获得相同程序的不同输出
- c - 包含按位运算符的代码未通过测试用例
- android - 单击通知“启动活动”时,Android 中的 Bundle savedInstanceState 为 null
- bash - 在 bash 代码中出现错误的替换错误
- c - C 预处理器中指向 void 的指针
- angular - 如何在 Angular7 中获取另一个响应的同时调用 HTTP 请求?
- r - 为绘图创建相关的下拉菜单
- julia - 匿名函数 Julia - x 的值
- c++ - 六角计算器问题。有人可以再次检查我的代码吗?
- angular - 我如何调用 laravel 护照的忘记密码并使用 angular 8 验证 api?