Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub API V3 : what is the difference between pushed_at and updated_at?

Tags:

github

api

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 ?

like image 425
Luca G. Soave Avatar asked Apr 10 '13 06:04

Luca G. Soave


1 Answers

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.

like image 122
Ivan Zuzak Avatar answered Nov 18 '22 04:11

Ivan Zuzak