如何做Git日志只看到合并到主分支? [英] How to do Git Log see only merges to master branch?

查看:185
本文介绍了如何做Git日志只看到合并到主分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的工作过程中,我需要向我的服务器管理员提供文件列表。
这个列表来自我的工作分支(分支A)到主分支的合并。

因此,我将分支A合并到分支主分支中,然后部署主分支。

现在我可以用 git log 做的最好的是以下内容,但是这个列表还包含其他提交不仅是我正在寻找的合并):

git log -m --name-only --author = [NAME]



所以基本上我需要检索合并 Branch A Master Branch



是否可以使用cli命令?

解决方案

使用 git log --merges --author 缩小它,找出您想要的提交并尝试

  git diff --name-only $ {MERGE_SHA} ^ 1 .. $ {MERGE_SHA} 


In my work process I need to provide a list of files to my server admin. The list comes from the merge of my working branch (Branch A) into Master branch.

So I merge branch A into branch Master and then deploy Master.

Right now the best I could do with git log is the following but this list contains other commit as well ( not only the merge I'm looking for ):
git log -m --name-only --author=[NAME]

So basically I need to retrieve the files list for the merge of Branch A into Master Branch

Is it possible with cli command ?

解决方案

Narrow it down using git log --merges --author to figure out the commit you want and then try

git diff --name-only ${MERGE_SHA}^1..${MERGE_SHA}

这篇关于如何做Git日志只看到合并到主分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆