Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print all the git commit message?

Tags:

git

jgit

I have a git repository, I can see all the commits in a particular branch using git log branch-name. But I want to print the commit message, author and date of all commits with respect to a particular branch on an HTML page. Is there any solution for this?
How can I use jgit for this?

like image 986
Gaurav Chaudhary Avatar asked Nov 24 '25 23:11

Gaurav Chaudhary


2 Answers

I don't know jgit, but in normal git you do that with the pretty option as

git log --pretty="%ci %an %s" branch-name

Where %ci is the date (ISO), %an is the commiter and %s is the subject.

EDIT

You can find more info in the log documentation, pretty format section : https://www.kernel.org/pub/software/scm/git/docs/git-log.html#_pretty_formats

like image 130
Alexandre DuBreuil Avatar answered Nov 26 '25 13:11

Alexandre DuBreuil


git log --pretty=oneline commit1...commit2 > file
like image 36
Sunny Sharma Avatar answered Nov 26 '25 14:11

Sunny Sharma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!