36

Looking to V3 API Repos (GET /repos/:owner/:repo) we have 3 datetime :

  "pushed_at": "2011-01-26T19:06:43Z",
  "created_at": "2011-01-26T19:01:12Z",
  "updated_at": "2011-01-26T19:14:43Z",

to have a fast example just link this https://api.github.com/repos/twitter/bootstrap

What is the difference between pushed_at and updated_at ?

Luca G. Soave
  • 12,271
  • 12
  • 58
  • 109

1 Answers1

46

UPDATE: the behavior described below wasn't intended. pushed_at will be updated any time a commit is pushed to any of the repository's branches. updated_at will be updated any time the repository object is updated, e.g. when the description or the primary language of the repository is updated. It's not necessary that a push will update the updated_at attribute -- that will only happen if a push triggers an update to the repository object. For example, if the primary language of the repository was Python, and then you pushed lots of JavaScript code -- that might change the primary language to JavaScript, which updates the repository object's language attribute and in turn updates the updated_at attribute. Previously, the primary language was getting updated after every push, even if it didn't change (which wasn't intended), so it triggered an update to updated_at.


The difference is that pushed_at represents the date and time of the last commit, whereas the updated_at represents the date and time of the last change the the repository. A change to the repository might be a commit, but it may also be other things, such as changing the description of the repo, creating wiki pages, etc. In other words, commits are a subset of updates, and the pushed_at timestamp will therefore either be the same as the updated_at timestamp, or it will be an earlier timestamp.

Ivan Zuzak
  • 18,068
  • 3
  • 69
  • 61
  • 1
    It's worth noting that these values apply to the entire repository. If an author updates say their "dev" branch this will update the "updated_at" attribute even though the default_branch (usually master) has not been pushed to. – braitsch Oct 16 '15 at 00:32
  • 1
    Strangely, I have noticed that the `pushed_at` flag gets updated even if anyone happens to open a `pullrequestevent` on any of the focal repository's branches (even without merging or closing it). The opened pull request can come from any remote fork. I am not sure why this us happening, since, a per my understanding, no commit is being made on any of the repos' branch in this particular case. – Poonacha May 30 '18 at 09:38
  • I think updated_at might be getting bumped even when the repository gets starred by someone. Or at least that's what my findings suggest. – Tomáš Hübelbauer Sep 26 '22 at 19:05