[英]How to know the size of GIT and SVN repository using shell script?
I am trying to write a shell script
, from which i can get to know the size of remote GIT
repository and SVN
repository. 我正在尝试编写一个
shell script
,从中我可以了解远程GIT
存储库和SVN
存储库的大小。
Example: 例:
My GIT repository
name : MyGITProject
Username : MMMMM
password : yyyyy
My SVN repository
name : MySVNProject
Username : SSSSSSS
password : kkkkkk
You can use git-sizer
for this purpose. 您可以为此使用
git-sizer
。 Here it has been explained completely on how to do this process. 在此已对如何执行此过程进行了完整的说明。 Note that you need a local copy of your git to be able to do so.
请注意,您需要git的本地副本才能这样做。
To make it as a shell script: 使其成为shell脚本:
git-sizer
in you shell git-sizer
Also, as a pure-shell workaround for SVN, I did this : 另外,作为SVN的纯壳解决方法,我这样做是:
du
recursively for the folders you need: du -sh --max-depth=x
(X the depth of folder structure) du
: du -sh --max-depth=x
(X文件夹结构的深度) Technically, this is not a good idea to put max-depth
to a high number. 从技术上讲,这不是将
max-depth
的好主意。 As your SVN might have astronomical number of files and folders in and this will bring a substantial overhead to your I/O and CPU. 由于您的SVN中可能有天文数字的文件和文件夹,这将给I / O和CPU带来巨大的开销。 But it can help you write a useful script.
但这可以帮助您编写有用的脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.