Method: Gitlab::Client::Commits#commits

Defined in:
lib/gitlab/client/commits.rb

#commits(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash> Also known as: repo_commits

Gets a list of project commits.

Examples:

Gitlab.commits('viking')
Gitlab.repo_commits('gitlab', { ref: 'api' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :ref (String)

    The branch or tag name of a project repository.

  • :page (Integer)

    The page number.

  • :per_page (Integer)

    The number of results per page.

Returns:


19
20
21
# File 'lib/gitlab/client/commits.rb', line 19

def commits(project, options = {})
  get("/projects/#{url_encode project}/repository/commits", query: options)
end