J
J
jFox2014-04-13 21:15:53
git
jFox, 2014-04-13 21:15:53

Rails: git commit, git pull - how to create a commit?

Most likely, the question will seem chaotic, but the fact that I myself understand the issue very superficially is to blame.
Therefore - I ask you not to judge me strictly.
I am creating a new rail application and it became necessary to create Pull Requests to a specific GitHub repository through this web application.
As a basis, it was decided to take the simplest and most understandable gem - Ghee
. However, I ran into the problem of creating a commit. How to create it on the server and how to attach it with Pull Request'y ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arkady Butermanov, 2014-04-13
@Arkadey

Maybe I didn’t understand the question ... But it seems something like this:
Push a commit to a new branch:

gh.repos("user","repo").git.commits.create({
  :message => "message of commit",
  :tree => "new_branch"
})

Create a PR with a new branch:
gh.repos("user", "repo").pulls.create({
    :title=>"take my awesome code!",
    :body=>"This code is so awesome. Let me tell you why...",
    :base=>"master",
    :head=>"new_branch"
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question