joc*_*ull 10 git git-remote git-gc
I'm using Git to version a series of binary files. They compress pretty well, but my central repos do not seem to be compressing when I push to them. They're eating up a decent amount of my quota, so I was looking to see if there was a way to force the remote repo to do a GC.
Is this possible? I'm working on Project Locker so I don't believe I have SSH access to go in and GC the repo myself. Any ideas? Thanks.
如果你不能自己跑git gc,你将不得不欺骗它自动运行.那时你不会完全控制它,但你应该至少能够让它运行起来.
git gc --auto由几个命令运行; 这里相关的是receive-pack,它在遥控器上运行以接收包作为推送的一部分.gc --auto只有当有足够的松散物体时才重新包装; 截止值由config参数决定gc.auto,默认为6700.
如果您可以访问遥控器的gitconfig,则可以暂时将该截止值设置为1.在回购中应该至少有一个松散的对象,所以这应该导致gc --auto下次你推动时做它的事情.
如果你无权访问遥控器的gitconfig,我所能想到的就是人为地创建一堆松散的对象.您可以通过创建分支,向其提交一堆小文件(具有不同内容),将分支推送到远程,然后从远程删除分支来实现.(重要的是改变内容,或者他们只使用相同的斑点.)冲洗并重复.