module Gitlab::Client::RepositoryFiles

def create_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) -- file content.
  • branch (String) -- the name of the branch.
  • path (String) -- full path to new file.
  • project (Integer, String) -- The ID or name of a project.
def create_file(project, path, branch, content, commit_message, options = {})
  post("/projects/#{url_encode project}/repository/files/#{url_encode path}", body: {
    branch: branch,
    commit_message: commit_message
  }.merge(options).merge(encoded_content_attributes(content)))
end