如何在不首先创建克隆的情况下查看远程Git存储库的最新提交? [英] How do I view the latest commits of a remote Git repository without making a clone first?

查看:104
本文介绍了如何在不首先创建克隆的情况下查看远程Git存储库的最新提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要获取某个远程Git存储库上最新的提交列表。但是,我不想创建一个克隆,因为这需要很长时间。

I want to get a list of the latest commits on a certain remote Git repository. However, I do not want to create a clone because that takes too long.

使用SVN,我可以简单地传递用户名和密码。有了Git,我还没有找到一个选择来做到这一点。此外,是否有像SVN一样的XML输出选项?

With SVN, I can simply pass along a username and password. With Git I haven't found an option to do this. Also, is there an XML output option like with SVN?

推荐答案

这可能不是您想要的,但您可以创建使用 - 深度选项的克隆 git clone 。这只克隆了最后的 n 版本。尽管如此,它仍然会复制所有内容。

This is probably not exactly what you want, but you could create a shallow clone using the --depth option to git clone. That clones only the last n revisions. It still copies all the content, though.

对于类似于XML的格式,您可以使用 custom log format 像这样:

For XML-like formatting you could use a custom log format like this:

git log --pretty=format:'<commit><author>%ae</author><subject>%s</subject></commit>'

这篇关于如何在不首先创建克隆的情况下查看远程Git存储库的最新提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆