gpt4 book ai didi

git - 如何在 git 中找到 commitId 的分支?

转载 作者:太空狗 更新时间:2023-10-29 13:30:56 24 4
gpt4 key购买 nike

假设我有一个提交 ID“0678dd19c498ede50e7714505eb5af3a5​​494beef”我尝试了“git log”命令,它打印出,

$git log --full-history   1c57338cd62ee1a83df57d2c37ce1f3fa17bee17
commit 1c57338cd62ee1a83df57d2c37ce1f3fa17bee17
Author: blah@blah.com
Date: Thu Feb 3 15:39:33 2011 -0800

Updated ejo syntax

commit 8fb7a6b3e44a020e4e495fd1c9a9976c8675c339
Author: blah@blah.com
Date: Thu Feb 3 14:49:19 2011 -0800

Added a sample controller

commit 628788eb81c365a88ab435ffa62978077065f72c
Author: blah@blah.com
Date: Wed Feb 2 11:33:41 2011 -0800

Test checkin

有没有打印提交的分支?

最佳答案

你想要的命令是

git branch --contains <commit>

请注意,提交可能包含在多个分支中。

关于git - 如何在 git 中找到 commitId 的分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13594324/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com