gitlab api How to get Last Commit? logs_tree?

2019-09-05 02:15发布

问题:

gitlab api How to get Last Commit?

GET /projects/:id/repository/tree

{
    "name": "assets",
    "type": "tree",
    "mode": "040000",
    "id": "6229c43a7e16fcc7e95f923f8ddadb8281d9c6c6"
  },?

How to get logs_tree? Last Commit?

回答1:

I would recommend follow the spec listed here which says that you can use
GET /projects/:id/repository/commits/tree
to return the following example data:

{
  "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
  "short_id": "6104942438c",
  "title": "Sanitize for network graph",
  "author_name": "randx",
  "author_email": "dmitriy.zaporozhets@gmail.com",
  "created_at": "2012-09-20T09:06:12+03:00",
  "message": "Sanitize for network graph",
  "committed_date": "2012-09-20T09:06:12+03:00",
  "authored_date": "2012-09-20T09:06:12+03:00",
  "parent_ids": [
    "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
  ],
  "status": "running"
}

This is the latest commit. In terms of finding logs_tree the full documentation may help you



标签: gitlab