class Github::Repos::Contents
def create(*args)
message: "my commit message"
content: "puts 'hello ruby'",
path: 'hello.rb',
github.repos.contents.create 'user-name', 'repo-name', 'path',
github = Github.new
= Examples
* committer.email - string - The email of the committer of the commit
* committer.name - string - The name of the committer of the commit
* author.email - string - The email of the author of the commit
* author.name - string - The name of the author of the commit
receive a 500 status code.
you choose to use author or committer. Otherwise, you’ll
You must provide values for both name and email, whether
information is omitted, the authenticated user’s information is used.
committer information if omitted. If the committer
The author section is optional and is filled in with the
= Optional Parameters
uses the repository’s default branch (usually master)
* :branch - Optional string - The branch name. If not provided,
which will be Base64 encoded
* :content - Requried string - The new file content,
* :message - Requried string - The commit message
* :path - Requried string - The content path
= Parameters
This method creates a new file in a repository
Create a file
def create(*args) arguments(args, :required => [:user, :repo, :path]) do assert_required REQUIRED_CONTENT_OPTIONS end params = arguments.params params.strict_encode64('content') put_request("/repos/#{user}/#{repo}/contents/#{path}", params) end