[英]searching merges with git log
Some dev merge comments "merged x into develop" are showing up in the "staging" branch, but they were never merged there. 一些开发人员将“将x合并为开发”的合并注释显示在“ staging”分支中,但从未在此处合并。 (not directly)
(不直接)
My best guess is someone merged dev into a task branch and then merged that in, but I'm having difficulty tracking it down with git log. 我最好的猜测是有人将开发人员合并到任务分支中,然后将其合并到其中,但是我很难用git log进行跟踪。
If I came to you and said, "something is wrong with the staging branch, I merged some changes into develop only (a few days ago) and now they are showing up in staging when they shouldn't" 如果我来找你说:“登台分支出了点问题,我(几天前)只将一些变更合并到开发中,现在它们出现在登台中,而本来不应该的”
How would you track down what happened through git log // diff-tree // etc. 您如何跟踪通过git log // diff-tree //等发生的情况。
(It seems like these kind of changes can get "hidden" by the merges and are difficult to find) (似乎这些更改可以被合并“隐藏”,并且很难找到)
If you have access to gitk
or another similar visualizer (there are several out there), gitk --all
would probably be the quickest way to identify it. 如果您可以访问
gitk
或其他类似的可视化工具(那里有多个可视化工具),则gitk --all
可能是识别它的最快方法。 git log
has a lot of options, though - git help log
is a long read, but there's quite a bit of detective work that can be done with git log
. git log
有很多选项,尽管git help log
很长,但是git log
可以完成很多侦探工作。 As suggested by @Irineau, git log --graph --oneline
will give you a textual representation of what gitk
would show (I would suggest git log --graph --oneline --all
in that case, though), but in the presence of many branches, it can get a bit hard to read. 正如@Irineau所建议的那样,
git log --graph --oneline
将为您提供gitk
所显示内容的文本表示(尽管我建议git log --graph --oneline --all
在所有情况下都如此),但是在存在许多分支机构,可能会难以阅读。
Another option would be something like git log --oneline --graph --all --merges
, or git log --oneline --graph --all --merges --ancestry-path <bad_sha_from_dev>..staging
. 另一种选择是
git log --oneline --graph --all --merges
或git log --oneline --graph --all --merges --ancestry-path <bad_sha_from_dev>..staging
。 A lot depends on exactly what you need to find and how you want it presented... 很大程度上取决于您需要找到什么以及如何显示它...
也许您可以使用git-log
的--graph
选项跟踪发生了什么:
git log --graph --oneline
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.