如何找出一个组织的所有Github上库的实际大小

问题描述 投票:0回答:2

我们正在我们的Github的库来与它GitLab - 服务器的本地服务器。我们将使用詹金斯服务器为建筑。

在此之前,我们想弄清楚,硬盘有多大是在两台机器上最小的。

- > Git的服务器将需要回购的磁盘空间 - >詹金斯 - 服务器将需要的磁盘空间用于建设回购+空间

因此:有没有办法找出多少磁盘空间,我们所有的仓库都在一起 - 不仅是实际的文件大小,但整个git仓库的真正大小?

我读到的API。但这样做

curl -i -u <myUserName>  https://api.github.com/orgs/<organisationName>

实际上,我可以接受,但元数据,它似乎不给有关实际使用的磁盘空间的任何信息:

HTTP/1.1 200 OK
Server: GitHub.com
Date: Fri, 09 Jun 2017 15:09:07 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 1463
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4980
X-RateLimit-Reset: 1497022865
Cache-Control: private, max-age=60, s-maxage=60
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
ETag: "62fadd06b840f42f8bf9cb69450b9d1b"
Last-Modified: Tue, 30 May 2017 12:33:36 GMT
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'none'
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
X-Runtime-rack: 0.068430
X-GitHub-Request-Id: XXXX:XXXX:XXXXXXX:XXXXXXX:XXXXXXX

{
  "login": "XXXXXXXX",
  "id": XXXXXXXXX,
  "url": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "repos_url": "https://api.github.com/orgs/XXXXXXX/repos",
  "events_url": "https://api.github.com/orgs/XXXXXX/events",
  "hooks_url": "https://api.github.com/orgs/XXXXXX/hooks",
  "issues_url": "https://api.github.com/orgs/XXXXXX/issues",
  "members_url": "https://api.github.com/orgs/XXXXXX/members{/member}",
  "public_members_url": "https://api.github.com/orgs/XXXXXX/public_members{/member}",
  "avatar_url": "https://avatars1.githubusercontent.com/XXXXXX",
  "description": "XXXXXX",
  "name": "XXXXXX",
  "company": null,
  "blog": "XXXXXX",
  "location": "XXXXXX",
  "email": "XXXXXXXXXXXXXXXXXXXX",
  "has_organization_projects": true,
  "has_repository_projects": true,
  "public_repos": 0,
  "public_gists": 0,
  "followers": 0,
  "following": 0,
  "html_url": "https://github.com/XXXXXXXXXXXXXX",
  "created_at": "2016-09-14T11:30:47Z",
  "updated_at": "2017-05-30T12:33:36Z",
  "type": "Organization",
  "total_private_repos": 62,
  "owned_private_repos": 62,
  "private_gists": null,
  "disk_usage": null,
  "collaborators": null,
  "billing_email": null,
  "plan": {
    "name": "team",
    "space": 976562499,
    "private_repos": 99999,
    "filled_seats": 15,
    "seats": 15
  },
  "default_repository_permission": null,
  "members_can_create_repositories": true
}

有一个标签space但它似乎是唯一使用的最大可用空间没有。而且,还有另一个标签disk_usagenull

git github repository github-api
2个回答
1
投票

也许git clone --bare所有这些,在磁盘检查大小?


0
投票

我用那种解决它到底

git lfs clone --mirror RepoURL localRepoFolder
cd localRepoFolder
git-lfs fetch --all
du -s
#cleanup
cd ..
rm -rf localRepoFolder

对于在循环中每一个仓库,并总结了所有大小

© www.soinside.com 2019 - 2024. All rights reserved.