确定分支何时合并到另一个分支 [英] Determine when branch was merged into another
问题描述
我有一个小型git回购,其中有多个分支
I've got a small git repo with multimple branches in in
我需要确定何时以及谁将特定分支合并到master. 我使用命令查看合并的分支
I need to determine when and who has merged particular branch to master. I use command to see merged branches
git branch --merged
但是我还需要确定何时以及由谁进行
But I also need to determine when and who did this
使用时更新 git log --merges
例如,我有两个分支
- 主人
- 版本/1
执行git log --merges
给我
commit 430c9e85e527ab1a63693265e220a8c72ed2fd14
Merge: c5ce3bffc 3ce4f8bff
Author: author1
Date: Thu Feb 23 07:15:55 2017 +0300
Merge branch 'master'
commit a909cf5d0100ef1621965f1f4275bd05c1495427
Merge: c2a2a4430 bfda36db3
Author: author1
Date: Thu Feb 23 05:41:32 2017 +0300
Merge branch 'feature/3'
commit c5ce3bffc4bde8dc60ae264781e9c990e67daaa1
Merge: 4107e0817 b03ef505f
Author: author2
Date: Tue Feb 21 11:00:56 2017 +0300
Merge branch 'release/1' of https://tfs.awesomecode.com/EpicSystems/_git/EPC into release/1
commit b03ef505f177eaf82a31164a97daa1d63c4146f8
Merge: 3f9b75bb7 0ee5e531d
Author: author1
Date: Tue Feb 21 09:20:31 2017 +0300
Merge branch 'release/1' of https://tfs.awesomecode.com/epicsystems/_git/EPC
所以我不太理解log的最后两个提交是做什么的.不清楚哪个将release/1合并到master中了
So I do not quite undestand what the last two commits from log do.. It's not obvious which one merged release/1 into master
推荐答案
您可以使用 git log .
master
分支执行一个
$ git log --merges
查看所有合并到master
的日志.
to see a log of all merges into master
.
为了更好地直观了解正在发生的事情,请尝试git log --decorate --oneline --graph
In order to get a better visual understanding of what is going on try out git log --decorate --oneline --graph
-
--decorate
将在日志条目中添加注释,显示诸如HEAD
之类的信息,以及该特定提交表示的分支提示(例如).origin/release/1
-
oneline
将产生更简洁的表示.每次提交只会显示主题行(您可以省略此行,但是我发现这样更容易理解图形) -
graph
将打印您的提交历史的图形表示,其中*
表示提交和行,以指示特定提交的父级
--decorate
will add annotations to the log entries showing informations likeHEAD
and which branch tip this particular commit represents e.g.origin/release/1
oneline
will produce a more concise representation. Every commit will only show the subject line (you can obviously omit this, but I find it easier to understand the graph this way)graph
will print a graphical representation of your commit history with*
representing commits and lines to indicate the parents of a particular commit
该图将在顶部显示最新提交
从这里开始,这是猜测,因为我不知道您的存储库的历史如何演变,但是我猜是以下情况:
From here on it's guesswork because I don't know how the history of your repository evolved, but I guess the following:
- 我真的不知道最后一次提交的含义,因为它似乎缺少了
into
部分 - 第二次提交(从底部开始)可能是由于
author2
更改为release/1
分支,而其他更改是对同一分支所做的冲突.这导致feature/1
合并到feature/1
(某种git rebase
也许) - 然后
feature/3
被合并了 - 然后
master
分支被合并
- I don't really know what the last commit means, because it seems to be missing the
into
part - The second commit (from the bottom) might come from conflicts between
author2
changes to therelease/1
branch while other changes where made to the same branch. This resulted in the merge offeature/1
intofeature/1
(some kind ofgit rebase
maybe) - Then
feature/3
was merged - Then the
master
branch was merged
这篇关于确定分支何时合并到另一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!