简体   繁体   English

如何直接从github.com获取git日志而不检出仓库?

[英]How to get git logs directly from github.com without checking out the repo?

Like I want to run the command(git log --since=2.days) from any remote host to github repo and get logs to the VM without the need of cloning the repo and then running the command mentioned before. 就像我想从任何远程主机运行命令(git log --since = 2.days)到github repo并获取日志到VM一样,而无需克隆repo然后运行前面提到的命令。

What will be the best approach to get the logs from the origin without checking out the code. 什么是从原始位置获取日志而不检出代码的最佳方法。

The Git protocol doesn't support this, but GitHub has an HTTP API to query information about repositories hosted there. Git协议不支持此功能,但是GitHub有一个HTTP API可以查询有关托管在此处的存储库的信息。

Direct link (also read the main page about the API to see how to authenticate using an API key, if you need to access information for a private repository): https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository 直接链接(如果需要访问私有存储库的信息,也请阅读有关API的主页,以了解如何使用API​​密钥进行身份验证): https : //developer.github.com/v3/repos/commits/#列表提交-ON-A-库

Example: 例:

curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/git/git/commits?sha=master&since=2019-03-18T11:00:00Z

Side note: GitHub also offers a GraphQL API and seems to be planning to phase out the previous APIs, but its documentation is significantly less easy to understand. 旁注:GitHub还提供了GraphQL API,并且似乎正计划逐步淘汰以前的API,但是其文档明显不那么容易理解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从回购中获取git日志。 在github.com? - how to get git log from a repo. in github.com? 将现有的git repo添加到github.com后,从github.com内部看不到 - After adding existing git repo to github.com, not visible from inside github.com 在github.com上分享私人git仓库 - Forking private git repo in github.com 如何获得 repo.network 的完整 github.com 可视化 - How to get the full github.com visualization of the /network of a repo 在 AWS 实例中克隆 git repo? 我收到错误:无法连接到 github.com 端口 443:连接超时 - Cloning a git repo in AWS Instance? I get the error : Failed to connect to github.com port 443: Connection timed out 从 Matlab 推送本地 git 存储库失败:您无法推送到 git://github.com/user/repo.git 使用 https://github.com/user/repo.git - Pushing local git repository from Matlab fails: You can't push to git://github.com/user/repo.git use https://github.com/user/repo.git 当我单击我的仓库时,如何直接登陆github.com上的非主分支 - How to directly land on a non-master branch at github.com when I click on my repo 从git://github.com/pengwynn/linkedin.git安装linkedin时如何解决git错误? - how to solve git error while installing linkedin from git://github.com/pengwynn/linkedin.git? Git Github.com HTML - Git Github.com HTML 如何从过去的git commit删除对象文件到github.com? - How to remove object files from past git commit to github.com?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM