从主分支的原始分支点开始,在git分支中显示所有提交

编程入门 行业动态 更新时间:2024-10-25 11:25:51
本文介绍了从主分支的原始分支点开始,在git分支中显示所有提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在寻找一种方法来查看自分支点(包括它)以来的活动分支上的所有提交,并希望自从master分支之后。

例如情况如下: pre $ code ABCD(master) \ EF(分支A)

我想获得提交F,E和B,而F是头。

ABCD(master) \\ \\ EF(分行B) \ G(分行C)

在G是当前HEAD的情况下,我想获得提交G,F,E,B。用--graph选项显示这些信息也是很好的。

现在我已经拿出了

git log master ^ .. HEAD

但似乎是显示太多信息(如来自其他分支的提交)。 感谢您的帮助!

解决方案

从如何运行Git Log来查看仅针对特定分支的更改?,这应该是足够的:

git log - 边界大师.. #或 git log --boundary --no-merges master ..

更简洁的表示形式:

git log - 边界 - 无合并--pretty ='%C(黄色)%h%d%Creset%an%Cgreen %ar:%Creset%s'--graph master ..

(add - 边界,如 torek comments ,以包括什么' B 'commit否则会是ex包含在git log结果中)

I'm looking for a way to view all commits on active branch since branching point (and including it) and hopefully since branching from master.

For example situation like:

A-B-C-D (master) \ E-F (branch A)

I want to get commits F, E and B while F is the HEAD.

And for

A-B-C-D (master) \ E-F (branch B) \ G (branch C)

I want to get commits G, F, E, B in case G is current HEAD. Displaying this information with --graph option would be also great.

For now I have come up with

git log master^..HEAD

But it seems to be displaying too much information (like commits from other branches). Thanks for your help!

解决方案

From "How Do I run Git Log to see changes only for a specific branch?", this should be enough:

git log --boundary master.. # or git log --boundary --no-merges master..

More concise representation:

git log --boundary --no-merges --pretty='%C(yellow)%h%d %Creset%an %Cgreen%ar:%Creset %s' --graph master..

(add --boundary, as torek comments, in order to include what 'B' commit which would otherwise be excluded from the git log result)

更多推荐

从主分支的原始分支点开始,在git分支中显示所有提交

本文发布于:2023-11-26 18:39:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634732.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分支   支点   原始   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!