是否可以使用简单的命令查看Git仓库的Git日志;换句话说,没有下载回购?
我想在Github上读取几个存储库的日志,并解析它们以获取某些统计信息。
例如,为此:
https://github.com/shumsky/Player
我尝试了git log -p github.com/shumsky/Player但得到了一个“含糊不清的参数”消息
我以前从未真正使用过Git。
由于
答案 0 :(得分:0)
在评论中提及 Pos5e5s3dFr3ak时,针对GitHub repos自动化查询的方法是使用their API:
例如,Git commits API page可以允许您获取提交数据(及其相关注释,日志的一部分),而无需克隆完整的存储库。
但您也可以查询README
文件,分叉(查看特定项目的其他克隆是否有活动),...
答案 1 :(得分:0)
Based on the Github API,这是您应该使用的API调用
curl -u '<your-github-username>' https://api.github.com/repos/<repo-user>/<repo-project>/commits
对于您可以使用的D3库:
curl -u '<your-github-username>' https://api.github.com/repos/mbostock/d3/commits > all-d3-commits.txt
这是一些输出。警告,它有很多数据。
[
{
"url": "https://api.github.com/repos/mbostock/d3/commits/183060d40ffce8a8bd233feeedd80f84d4707642",
"committer": {
"type": "User",
"repos_url": "https://api.github.com/users/mbostock/repos",
"subscriptions_url": "https://api.github.com/users/mbostock/subscriptions",
"url": "https://api.github.com/users/mbostock",
"gists_url": "https://api.github.com/users/mbostock/gists{/gist_id}",
"received_events_url": "https://api.github.com/users/mbostock/received_events",
"avatar_url": "https://secure.gravatar.com/avatar/005a27e09fe946ebef64bf4d134efc0a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
"login": "mbostock",
"organizations_url": "https://api.github.com/users/mbostock/orgs",
"events_url": "https://api.github.com/users/mbostock/events{/privacy}",
"gravatar_id": "005a27e09fe946ebef64bf4d134efc0a",
"followers_url": "https://api.github.com/users/mbostock/followers",
"id": 230541,
"starred_url": "https://api.github.com/users/mbostock/starred{/owner}{/repo}",
"following_url": "https://api.github.com/users/mbostock/following"
},
"sha": "183060d40ffce8a8bd233feeedd80f84d4707642",
"author": {
"type": "User",
"repos_url": "https://api.github.com/users/mbostock/repos",
"subscriptions_url": "https://api.github.com/users/mbostock/subscriptions",
"url": "https://api.github.com/users/mbostock",
"gists_url": "https://api.github.com/users/mbostock/gists{/gist_id}",
"received_events_url": "https://api.github.com/users/mbostock/received_events",
"avatar_url": "https://secure.gravatar.com/avatar/005a27e09fe946ebef64bf4d134efc0a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
"login": "mbostock",
"organizations_url": "https://api.github.com/users/mbostock/orgs",
"events_url": "https://api.github.com/users/mbostock/events{/privacy}",
"gravatar_id": "005a27e09fe946ebef64bf4d134efc0a",
"followers_url": "https://api.github.com/users/mbostock/followers",
"id": 230541,
"starred_url": "https://api.github.com/users/mbostock/starred{/owner}{/repo}",
"following_url": "https://api.github.com/users/mbostock/following"
},
"comments_url": "https://api.github.com/repos/mbostock/d3/commits/183060d40ffce8a8bd233feeedd80f84d4707642/comments",
"parents": [
{
"url": "https://api.github.com/repos/mbostock/d3/commits/11a19ec03d21a2908ce2d0ceed954e6a41a58cfc",
"sha": "11a19ec03d21a2908ce2d0ceed954e6a41a58cfc"
}
],
"commit": {
"url": "https://api.github.com/repos/mbostock/d3/git/commits/183060d40ffce8a8bd233feeedd80f84d4707642",
"committer": {
"email": "mbostock@gmail.com",
"date": "2013-01-24T17:26:22Z",
"name": "Mike Bostock"