8

I am working on a project where I need to know when exactly a commit was pushed to a remote repository on Github. Using the git APIs and commands I can only find the commit's 'authored_date' and 'committed_date', which represent the time of the commit at the local repository.

I tried the approaches presented in this question: Is there a way in git to obtain a push date for a given commit?. They only work when a commit was pushed from the same local machine, while I need them for commits in a cloned projects.

Thank you.

2
  • Possible duplicate of Is there a way in git to obtain a push date for a given commit? Commented Jan 9, 2018 at 20:02
  • 3
    In that question, the answers do not describe a way of getting a push date for a specific commit. Second, they only show the pushes done from the machined being used. Please, reconsider my question as I see that it is not a duplicate of that one. Thanks. Commented Jan 10, 2018 at 21:22

1 Answer 1

2

Try to play with List Repository Events

For example: https://api.github.com/repos/JetBrains/kotlin/events

It returns all the events for the repository. Look there for the event with type="PushEvent" containing your commit SHA in the payload/comits/sha

This approach has some limitations:

  • you can not request filtered events by type, you are only able to fetch them all and filter them on your side
  • Only events created within the past 90 days will be included in timelines (according to GitHub doc)
  • you have to care about pagination if you have massive events on your project
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.