Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to remote count object and size of git repository?

Assume that somewhere in the web exists public git repository. I want to clone it but firstly i need to be sure what is size of it (how much objects & kbytes like in git count-objects)

Is there a way to do it?

like image 760
dfens Avatar asked May 21 '10 13:05

dfens


People also ask

How do I find the size of a git repository?

To find the size of your . git directory, use du – sh . git. You can use git count-objects -v to count the number of unpacked object files and disk space consumed by them.

Can a git repo have two remotes?

You can add multiple remotes by using git remote or git config commands or editing the config file. As git can group multiple remotes, you can follow any of the following ways to configure multiple remotes to push simultaneously(no need all). You can set multiple remote URLs to a single remote using git remote.

What is the size limit of git repository?

Maximum repository size is 10GB The total repository size will be limited to 10GB. You will receive warning messages as your repository size grows to ensure you're aware of approaching any size limits. Eventually, if the repository size exceeds the limit, you will receive an error message and the push will be blocked.


1 Answers

One little kludge you could use would be the following:

mkdir repo-name cd repo-name git init git remote add origin <URL of remote> git fetch origin 

git fetch displays feedback along these lines:

remote: Counting objects: 95815, done. remote: Compressing objects: 100% (25006/25006), done. remote: Total 95815 (delta 69568), reused 95445 (delta 69317) Receiving objects: 100% (95815/95815), 18.48 MiB | 16.84 MiB/s, done. ... 

The steps on the remote end generally happen pretty fast; it's the receiving step that can be time-consuming. It doesn't actually show the total size, but you can certainly watch it for a second, and if you see "1% ... 23.75 GiB" you know you're in trouble, and you can cancel it.

like image 103
Cascabel Avatar answered Oct 12 '22 14:10

Cascabel