Eldad Mor
Eldad Mor

Reputation: 5525

Getting comments on all pulled commits in git

I'm using git to manage my project. As a part of the nightly build I have a script that pulls the changes and compiles them. I want to get all the comments for all the commits that were pulled in order to make a readable changelog. My assumption is that the commit comments are all good of course.

How do I do that?

Upvotes: 0

Views: 196

Answers (2)

holygeek
holygeek

Reputation: 16195

Do this right after git pull:

$ git log ORIG_HEAD..

Upvotes: 1

lebreeze
lebreeze

Reputation: 5134

We use the following to compare two branches (or commits)

git log --oneline --abbrev=10 master..develop > changelog.txt

That will output something like...

bb210b5a93 Made some changes
2ce854f780 Made some more changes

...and put them in changelog.txt

UPDATED

git rev-parse HEAD # returns current git commit hash

You could use the output of that before you git pull to use the original commit to compare against.

Upvotes: 1

Related Questions