简体   繁体   中英

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.

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. 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.

To make it as a shell script:

  1. Make a local copy of your git repository.
  2. Change directory to there, run git-sizer in you shell
  3. Echo the output to a file, you can strip the output to only give you the information you need.

Also, as a pure-shell workaround for SVN, I did this :

  1. Update SVN
  2. Run du recursively for the folders you need: du -sh --max-depth=x (X the depth of folder structure)

Technically, this is not a good idea to put max-depth to a high number. 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. But it can help you write a useful script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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