2

Using node-gitlab API in NodeJS application, how can i get a project's list of commits. I could get the list of projects using:

router.get('/projects', function(req, res, next) {
    gitlab.projects.all(function(projects) {
    res.json(projects);
    console.log(projects);
  });
});

Thanks

2 Answers2

1

I found the way to do it

gitlab.projects.repository.listCommits(projectId,function(commits) {

});

0

it's not documented in the api, but i found it in the repository.js file of the package:

gitlab.repository.getCommits(id, ref_name)

id: projectId,

ref_name: name of a repository branch or tag or if not given the default branch

Tobias Neis
  • 69
  • 1
  • 5