【问题标题】:Find the commit current *master* refers to查找当前 *master* 指的提交 【发布时间】:2022-12-13 17:03:07 【问题描述】: 如果我想知道哪个提交当前掌握分支指的是,我该怎么做? 有没有办法在 GIT 中检查 master 的 SHA1? 【问题讨论】: 这回答了你的问题了吗? How do I get the hash for the current commit in Git? 当然,git rev-parse some-branch 应该给你分支指向的提交 ID(据你目前所知......如果它是一个远程分支,它可能已经移动并且在你获取之前你不会知道它) . 标签: git 【解决方案1】: 是的,您可以为此使用 rev-parse 命令: git rev-parse master 这将返回 master 分支引用的提交的 SHA-1。 【讨论】: