How do I show just the names and commit titles since a tag in Git?

后端 未结 5 1471
逝去的感伤
逝去的感伤 2021-01-30 08:32

I\'m trying to use tags for release management in Git—I create a tag for each release. I\'d like to be able to create release notes by listing the comment titles for every commi

相关标签:
5条回答
  • 2021-01-30 08:43

    In order to get detailed infos on commit with a certain (known) message, I firstly call git log --oneline for overview of commints with messeges and then by the identified SHA view the commit with git show <SHA> or git log --stat -p <SHA>

    0 讨论(0)
  • 2021-01-30 08:49

    I combined Dominic's and Igor's answers together to return the titles of all commits from 2b150c4 to the current HEAD in chronological order and prints it to Terminal (echo added because git log doesn't line break the last line).

    git log --pretty=format:%s 2b150c4..HEAD --reverse | cat; echo
    
    0 讨论(0)
  • 2021-01-30 08:52

    If your tags are named LastRelease and NextRelease then do

    git log --pretty=format:%s LastRelease..NextRelease .

    0 讨论(0)
  • 2021-01-30 08:57

    You should look into git shortlog. Here's an example of the output:

    $ git shortlog
    Al Jones (512):
          Added to .gitignore file
          Updated user model
    
    Bob Smith (222):
          Minor tweak to view
          Updated accounts controller
    
    Charles West (321):
          Started specs for user model
          Finished specs for user model
    

    For your case you would want to run git shortlog LastRelease..NextRelease

    0 讨论(0)
  • 2021-01-30 09:08

    To show commits since TAG to current head:

    git log TAG..HEAD
    

    Between two commits:

    git log TAG..TAG
    

    For formatting the log output have a look at Pretty formats section of git log.

    0 讨论(0)
提交回复
热议问题