简体   繁体   English

如何不做拉就看最后的远程提交评论

[英]How to see last remote commit comment without doing pull

I am trying to find a way to see the last remote commit comments without doing a pull. 我正在尝试找到一种无需进行拉动即可查看最近的远程提交注释的方法。

I know I can do a 我知道我可以

git log -1

to see the local commit, but what can I do for the remote commit? 查看本地提交,但是对于远程提交我该怎么办?

To answer the question as asked: there's no stock way at all to show remote commits, you need the actual objects present to inspect them. 要回答所问的问题:根本没有显示远程提交的库存方式,您需要存在的实际对象才能对其进行检查。 To get the remote to run any pre-prepared code you want, best I can do is write a pre-receive exit that hunts for special branch names and runs prepared commands before rejecting the push to any of them. 为了使远程程序运行您想要的任何预先准备的代码,最好的办法是编写一个预先接收的出口,该出口搜寻特殊的分支名称并运行准备好的命令,然后拒绝任何命令的推送。 It's a rather disgusting kludge even as kludges go. 即使发生纠缠,这也是一种令人恶心的纠缠。

But as the commenters point out, fetched commits are compressed extremely well, there'd have to be some very special reason not to do it the easy way. 但是正如评论者所指出的那样,提取的提交被压缩得非常好,因此必须有一些非常特殊的原因才能不采用简便的方法。

You can use 您可以使用

git fetch origin

to fetch commits from the remote origin . 从远程origin获取提交。 Now you can see the commit messages with 现在您可以看到提交消息

git log origin/master

(Replace origin/master with whichever branch you wish to view.) (用您要查看的任何分支替换origin/master节点。)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM