Method: Gitlab::Client::Commits#create_commit
- Defined in:
- lib/gitlab/client/commits.rb
permalink #create_commit(project, branch, message, actions, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a single commit with one or more changes
Introduced in Gitlab 8.13
Gitlab.create_commit(2726132, ‘master’, ‘refactors everything’, [‘create’, file_path: ‘/foo.txt’, content: ‘bar’]) Gitlab.create_commit(2726132, ‘master’, ‘refactors everything’, [‘delete’, file_path: ‘/foo.txt’])
189 190 191 192 193 194 195 196 |
# File 'lib/gitlab/client/commits.rb', line 189 def create_commit(project, branch, , actions, = {}) payload = { branch: branch, commit_message: , actions: actions }.merge() post("/projects/#{url_encode project}/repository/commits", body: payload) end |