从远程存储库获取所需提交的 sha1
使用 git reflog ,用户只能访问他本地的 reflog 信息?
如何从远程存储库查看所需提交的 sha1?
Using git reflog
, a user can only access his local reflog information?
How can one see the sha1 of a desired commit from a remote repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Git reflog 是您签出的 sha1 的历史记录。对于您所在的任何存储库都是如此。如果删除您的存储库并再次克隆它,您将丢失该历史记录。
第二个问题没有意义。我猜您想要 git fetch ,然后浏览遥控器上尚未合并的内容。您可以使用 git log master..origin/master 来查看远程主机有哪些您没有的内容。
Git reflog is a history of sha1s you had checked out. This is true for whatever repository you're in. If delete your repository and clone it again, you will have lost that history.
The second question doesn't make sense. I'm guessing that you want to
git fetch
and then browse what is on the remote that you didn't merge yet. You would do that withgit log master..origin/master
to see what the remote master has that you don't.如果您想要特定分支的 SHA1,您可以尝试
,或者,如果分支名称模式不明确并且您想要更多控制,可能类似于:
或类似的内容。它也适用于标签,但看起来没什么其他作用。
If you want the SHA1 of a particular branch, you could try
or, if the branch name pattern is ambiguous and you want more control, maybe something like:
or something like that. It also works for tags, but it looks like not much else.
我知道这是一个老问题,但我需要 从特定提交分支< /a> 并且需要知道该提交的 SHA 才能执行此操作。在找到如何从 GUI(SourceTree)执行此操作后,我还找到了如何从命令行执行此操作。以下是步骤。
使用命令
git log
使用源树
1. 找到您要查找的提交
2.右键单击它
3. 选择“将 SHA 复制到剪贴板”
I know this is an old question, but I needed to branch from a particular commit and needed to know the SHA of that commit in order to do so. After finding out how to do it from a GUI(SourceTree) I also found out how to do it from the command line. Here are the steps.
Using the command line
git log
Using SourceTree
1. Find the commit that you're looking for
2. Right click on it
3. Select "Copy SHA to Clipboard"