从git中删除大的提交 [英] Remove large commits from git

查看:99
本文介绍了从git中删除大的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在运行一个中央git存储库(gforge),每个人都从中拉出并推送。不幸的是,一些不合适的同事决定将几个10-100Mb的jar文件放入回购库是个好主意。由于这个原因,我们使用的服务器已经耗尽了磁盘空间。



我们只有在太晚时才意识到这一点,而且大多数人已经拉回了新的巨额回购协议。如果问题没有被推动,那么我们可以做一个重定位来分割那些巨大的提交并修复它,但是现在每个人都已经从中撤出了,那么删除该提交的最好方法是什么(或者做一个rebase删除大文件),然后让这个不是在每个人都想要从/回推到回购站时造成混乱?

它应该是是一个脚本的小回购站,但现在大小约为700M: - (

检查出来 https://help.github.com/articles/remove-sensitive-data 。从你的Git仓库中删除敏感数据,但你可以很好地使用它从你的提交中删除大文件。


We're running a central git repository (gforge) that everyone pulls from and pushes to. Unfortunately, some inept co-workers have decided that pushing several 10-100Mb jar files into the repo was a good idea. As a consequence of this, our server we use a lot has run out of disk space.

We only realised this when it was too late and most people had pulled the new huge repo. If the problem hadn't been pushed, then we could just do a rebase to snip out those huge commits and fix it, but now everyone has pulled from it, what is the best way to remove that commit (or do a rebase to just remove the large files) and then have this not cause chaos when everyone wants to pull/push from/to the repo?

It's supposed to be a small repo for scripts, but is now about 700M in size :-(

解决方案

Check this out https://help.github.com/articles/remove-sensitive-data . Here they write about removing sensitive data from your Git repository but you can very well use it for removing the large files from your commits.

这篇关于从git中删除大的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆