我正在使用gitk
and查看提交历史记录,git log
并试图查看特定提交是如何到达某个分支的。我可以看到历史中的提交,所以我知道它们在那里。
我想了解的是它们是如何合并的(它们应该保留在自己的分支上)。这是一个非常大的项目,在有问题的提交和分支的当前状态之间有数百个提交,所以我无法清楚地破译有限的 DAG gitk
,并且提交在其他分支中被掩盖并合并和提交消息。
为此,我一直在尝试:
gitk {sha1hashIDstring}..branch_name
gitk {sha1hashIDstring}..branch_name --ancestry-path
git log {sha1hashIDstring}..branch_name --reverse
git log {sha1hashIDstring}..branch_name --merges --reverse
git log {sha1hashIDstring}..branch_name --ancestry-path --reverse
git log {sha1hashIDstring}..branch_name --ancestry-path --merges --reverse
我不理解结果。我只想查看包含相关特定提交的项目,以便我清楚地看到它是如何进入相关分支的。我该怎么做?
例子
我正在寻找的东西,gitk
最好但git log
就足够了:
Message Author Date #commit that merged branch z into current branch
Message Author Date #commit that merged branch y into branch z
Message Author Date #commit that merged branch x into branch y
Message Author Date #commit that merged {sha1hashIDstring} commit/branch a into branch x
Message Orig_Author Date #{sha1hashIDstring} original commit, on branch a
更多信息
我还没有看到任何答案,所以如果没有答案,我会开始赏金,但也许我没有正确解释这个问题(我愿意接受改进和澄清的建议)。
这样做的驱动力是我可以看到提交本身,并且有人告诉我它不应该在某个分支上。这是我所看到的:
Message Orig_Author Date #{sha1hashIDstring} commit
Message Orig_Author Date #Merged into branch test_dec14 (includes original commit)
...
Message Author Date # unrelated commits
Message Author Date # more unrelated commits
# Stuff happened here ??? everything I do gives me hundreds of things here
# Not all of them related to the {sha1hashIDstring} commit
# No idea how to see only the ones that are
...
Message Author Date # final commit on test_jan15 branch
有人告诉我,除非它们被释放,否则test_dec14
不应提交 in test_jan15
,因此 {sha1hashIDstring} 提交不应该在test_jan15
,但确实如此。我想知道为什么,它是如何到达那里的,以及是谁把它放在那里的。