module Gitlab::Client::RepositoryFiles

def edit_file(project, path, branch, content, commit_message, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) -

Options Hash: (**options)
  • :author_email (String) -- Commit author's email address
  • :author_name (String) -- Commit author's name

Parameters:
  • options (Hash) -- Optional additional details for commit
  • commit_message (String) -- ...commit message.
  • content (String) -- new file content.
  • branch (String) -- the name of the branch to commit changes to.
  • path (String) -- full path of file to update.
  • project (Integer, String) -- The ID or name of a project.
def edit_file(project, path, branch, content, commit_message, options = {})
  put("/projects/#{url_encode project}/repository/files/#{url_encode path}", body: {
    branch: branch,
    commit_message: commit_message
  }.merge(options).merge(encoded_content_attributes(content)))
end