Consider the following commit history:
1---R---3---5---P-> # patch-v1.1
\ \
2---4---+---8---+---10---R-> # release-v2.0
\ /
6---7---9 # feature-foo
--> time
# 1 - 10 are commits
# P is a patch release commit
# R are major release commits
# + marks a merge commit
I want to generate the changelog for release-v2.0
, but since P (patch-v1.1)
has already been released, it's changes should not be part of the v2.0
changelog. Can I configure the git log
command to only list commits 2, 4, 6 .. 11
(i.e., commits from release-v2.0
and feature-foo
)?
Many times it's useful to know which branch or tag each commit is associated with. The --decorate flag makes git log display all of the references (e.g., branches, tags, etc) that point to each commit.
Git Log OnelineThe oneline option is used to display the output as one commit per line. It also shows the output in brief like the first seven characters of the commit SHA and the commit message. It will be used as follows: $ git log --oneline.
log --all is only for listing commits referenced in refs/ (like tags, heads, ...) The same page also says: The --all option does not tell git log to display all commits. It asks for the logs of all refs, basically your branches and tags.
Use git log R --not P
. That's the same as git log P..R
from @micha-wiedenmann's comment, but I find the former syntax more speaking. And yes, it will include 2, 4, 6, 7, 9
as it does not matter when they chronologically happened (in terms of time authored), but where they are in the DAG. With R --not P
you basically create the complement of P in R in terms of set theory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With