在TFS 2013托管的远程Git存储库上有没有办法对git / prune进行git? [英] Is there a way to git gc / prune on a remote Git repository hosted by TFS 2013?

查看:161
本文介绍了在TFS 2013托管的远程Git存储库上有没有办法对git / prune进行git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着时间的推移,对于托管在TFS 2013(Update 4)上的Git仓库, .git 文件夹的大小会增加。

<每当克隆这些存储库时, .git 文件夹的大小最初可能很大,直到 git gc --aggressive --prune = now 手动执行。



微软说,TFS 2013不会自行执行 git gc 操作。
不幸的是,它似乎也不可能强制TFS做到这一点。



有没有办法gc / prune托管在TFS 2013中的Git存储库减少.git目录的初始大小?

解决方案

在此找到答案:
https://connect.microsoft。 com / VisualStudio / feedback / details / 1019193 / unable-to-clean-a-git-repo-in-tfs


TFS目前无法执行我们知道这是一个非常重要的特性,我们正在追踪它在我们的待办事项中。目前,如果你执行一个git克隆,TFS会尝试优化处理速度并且交给你所关联的所有对象在没有过滤的情况下,假设几乎所有的数据都是活的/可访问的。在执行一个过滤操作之后,它可能会谨慎地从你的TFS服务器删除整个git仓库,并使用本地修剪和重新包装的git仓库创建一个新仓库。所有删除存储库时的标准警告都适用 - 您将丢失与该存储库相关的所有权限信息和任何TFS状态,并且您必须适当地重新创建它们。


Over time the size of .git folder grows for Git repositories hosted on TFS 2013 (Update 4).

Whenever cloning those repositories, .git folder can be huge in size initially, until git gc --aggressive --prune=now is performed manually.

Microsoft says, that TFS 2013 does not perform git gc operations on its own. Unfortunately, it also seems impossible to force TFS to do that.

Is there a way to gc/prune a Git repository hosted in TFS 2013 to reduce the initial size of .git directory?

解决方案

Found answer here: https://connect.microsoft.com/VisualStudio/feedback/details/1019193/unable-to-clean-a-git-repo-in-tfs

"TFS does not currently perform garbage collection on git objects. We are aware that this is an important feature to have and we are tracking it in our backlogs. Currently, if you perform a git clone, TFS attempts to optimize for processing speed and hands you all objects that were associated with that repo without filtration, under the assumption that almost all of it will be live/reachable. After a filter operation like the one you performed, it might be prudent to delete the entire git repository from your TFS server and create a new one using the locally pruned and repacked git repo. All the standard caveats when deleting a repository apply - you lose all permission information and any TFS state associated with that repository and you will have to recreate them appropriately."

这篇关于在TFS 2013托管的远程Git存储库上有没有办法对git / prune进行git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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