yaylitzis
yaylitzis

Reputation: 5534

Download commit messages from project in GitHub

I have a project in GitHub and during the last years I have committed several changes to the project. In each commit I was adding a small text about the commit (e.g. fix problem with function A).

Is there a way to download all the commits that I have committed so far ?. I don't want to download the changes of the code of each commit, just only the text that I was writing.. Is this possible?

Upvotes: 2

Views: 1316

Answers (2)

NullDev
NullDev

Reputation: 7303

GitHub has an API for that.

https://api.github.com/repos/(username)/(repository)/commits

See REST API v3: Commits

List commits on a repository
GET /repos/:owner/:repo/commits

You can then just read all message keys in the commit objects

Edit:

If you try to do that on a private repository, you have to make an authentication first.

Basic example with curl:

curl -u username:password https://api.github.com/repos/username/repository/commits

More on that: Other Authentication Methods

Upvotes: 2

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521289

Assuming you did the work from your local Git project, then GitHub does not have to be involved at all here. You can checkout the branch in question, fetch update it, and then use git log:

git checkout master           # assuming contributions go to the master branch
git pull origin master
git log --author="yaylitzis"  # replace 'yaylitzis' with your actual username

The pull is required because perhaps your local branch does not have all your commits for some reason.

Upvotes: 1

Related Questions