如何获取git中最后一次推送的ID? [英] How do I get the ID of the last push in git?
问题描述
我想获取上一次收到的推送的ID(不是git rev-parse HEAD
).
I'd like to get the ID for the last push received (not git rev-parse HEAD
).
例如,如果我执行git diff-tree --name-status master
,它将显示自上次推送以来的所有更改,但是我想查看特定一次推送的更改.
For example, if I do git diff-tree --name-status master
it will show me all changes since the last push, but I want to see changes at a specific push.
推荐答案
如果您要谈论的是您(即您的仓库)从给定的分支(针对给定的分支)收到的最后一次推送(例如,大师):
If you are talking about the last push that you (ie your repo) received from a given remote, for a given branch (like, for instance, master):
git rev-parse origin/master
(此博客帖子通过列出自上次推送以来的更改来说明:
git log origin/master.. --stat
(this blog post illustrates it by listing changes since last push:
git log origin/master.. --stat
问题" git错误地指出,我比提交人/主机高出1次提交")
Once you have the right SHA1, you can look at "How can I see all the files that were modified/added/removed in the last push received?" for more.
这篇关于如何获取git中最后一次推送的ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!