查看没有合并提交的git日志 [英] View git log without merge commits

查看:239
本文介绍了查看没有合并提交的git日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试查看特定用户的提交,并希望从输出中删除该用户完成的所有合并.我该怎么办?

I'm trying to view commits made by a specific user, and want to remove any merges done by the user from the output. How can I do so?

我可以使用git log --author=<name>检查用户的提交,但不能删除输出中的合并提交.

I can check for the commits of a user using git log --author=<name>, but can't remove the merge commits in the output.

PS:在所讨论的回购流程中不会发生合并冲突,所有分支在合并到母版之前都已重新建立基础,因此可以安全地从输出中删除合并提交,并且类似地,两个要素分支也不会与之合并互相提高了可能性.

PS: Merge conflicts do not happen in the workflow of the repo in question, all branches are rebased before merging into master so it is safe to remove the merge commits from the output, and similarly, two feature branches are not merged with one another raising the possiblity.

推荐答案

使用

git log --author=<name> --no-merges

此外,--first-parent选项可能会为您提供有用的结果:

Additionally the --first-parent option may give useful result for you:

-第一亲 看到合并提交后,仅遵循第一个父提交.查看以下内容时,此选项可以提供更好的概览 特定主题分支的演变,因为合并 进入主题分支往往只是不时地调整为更新上游,而该选项使您可以 忽略导入到您的个人提交中 这样的合并历史.不能与--bisect组合.

--first-parent 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. Cannot be combined with --bisect.

这篇关于查看没有合并提交的git日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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