Search code examples
githubgithub-api

Get last commit date of a file with github api


The normal GET /repos/:owner/:repo/contents/:path doesn't contain any information about date.


Solution

  • Edit:

    1. In order to find the date of specific file look here - https://api.github.com/repos/:owner/:repo/commits?path=PATH_TO_FILE

    you can see here the date of the commit which is the date when the file uploaded to git.

    1. check this path - https://api.github.com/repos/:owner/:repo/commits

    inside you can see both commit date and the files of the commit

    enter image description here