git日志只返回对主分支进行的提交? [英] git log to return only the commits made to the master branch?

查看:331
本文介绍了git日志只返回对主分支进行的提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些搜索,发现:

I've done a bit of searching and found:

git log myBranchName

作为可能的解决方案。但是当我的分支是主分支时会发生什么?当我运行时:

as a possible solution. But what happens when my branch is the master branch? when I run:

git log master

它似乎将所有提交给任何分支的东西都返回。根据我读过的内容,它列出了与主分支相关的所有提交。知道了,我怎样才能调用master分支的提交历史记录?

It seems to return everything commited to any branch. Based on what I've read, it lists all of the commits related to the master branch. Knowing that, how I can call up the commit history of the master branch only?

推荐答案

我认为这就是你想要的

git log --first-parent master

引用手册


在看到合并提交时,只跟随第一个父提交。这个
选项可以在查看
特定主题分支的演变时给出更好的概述,因为合并到主题分支往往只是
,而不是随时调整到更新的上游;这个
选项允许你忽略通过这种合并引入你的
历史记录的单个提交。

Follow only the first parent commit upon seeing a merge commit. This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge.

这篇关于git日志只返回对主分支进行的提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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