简体   繁体   English

使用NGit获取克隆的大小

[英]Getting the size of a clone with NGit

Is it possible to use NGit to clone repository, but get the size of a repo before you simply "download it"? 是否可以使用NGit克隆存储库,但在您简单地“下载”存储库之前获得存储库的大小?

I am trying to build a client, and I'd like to actually display progress or have the option of cancelling it if its too huge. 我正在尝试建立一个客户端,我想实际显示进度,或者如果进度太大,可以选择取消进度。

Is there a way to do this using code? 有没有办法使用代码来做到这一点?

No, there is no way to know how much data will you will need to transfer before cloning/fetching using the git transport protocol. 不,没有办法知道在使用git传输协议进行克隆/获取之前需要传输多少数据。

If you clone via dumb-HTTP you could probably get the pack-file sizes from the web server. 如果通过哑HTTP克隆,则可能会从Web服务器获取打包文件的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM