Search code examples
githubgithub-api

Is it possible to get commits history for one file in github api?


I would like to get all commit messages for separate file in github REST api. But all I got - only to get all commits for separate branch. Then I tried to get following:

http://api.github.com/users/<username>/<project>/commits/<branch>/<path/to/file>

But that didn't help also. Is this at least possible?


Solution

  • Try this (as described in the API docs here):

    http://api.github.com/repos/:owner/:repo/commits?path=PATH_TO_FILE

    e.g.

    https://api.github.com/repos/izuzak/pmrpc/commits?path=README.markdown


    Extra: Get commits history for one file from a specific branch