-2

New to git and Github. An author suggested in an issue discussion that I make a pull request. I cloned his repo with the recommended HTTPS link on my personal machine (not to another Github repo) and committed my edits. Now I'm trying to generate a pull request but I'm not sure how. The solutions I've found looking around haven't been helpful. Below is the output of my Bash git commands.

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ git remote -v
origin  ssh://git@github.com/repo.git (fetch)
origin  ssh://git@github.com/repo.git (push)

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ ssh -T git@github.com
Permission denied (publickey).

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ eval "$(ssh-agent -s)"
Agent pid 7180

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ ssh-add ~/.ssh/id_rsa_github
Identity added: /c/Users/User/.ssh/id_rsa_github 
    (/c/Users/User/.ssh/id_rsa_github)

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ ssh -T git@github.com
Hi GithubUser! You've successfully authenticated, 
    but GitHub does not provide shell access.

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ git push --dry-run origin master
ERROR: Permission to repo.git denied to GithubUser.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ git remote set-url origin https://GithubUser@github.com/repo.git

User@MachineName ODKWK52 /c/websites/github/repo (master)
$ git push --dry-run origin master
Password for 'https://GithubUser@github.com':
remote: Permission to repo.git denied to GithubUser.
fatal: unable to access 'https://GithubUser@github.com/repo.git/': 
    The requested URL returned error: 403

That error seems to be addressed on this official page but the info there isn't helpful because my SSH key has never been used elsewhere (I generated it just to do this push) and because the failure happens over both HTTPS and SSH. As you can see, the SSH test is run successfully so I'm not sure why I'm running into this error.

Again, this is not my Github repo. The author suggested I make a pull request and I'm wondering how to do that. Must I clone the project into another Github repo and push to it? (I saw that recommendation here) I don't see why that would be necessary.

Community
  • 1
  • 1
BeetleJuice
  • 39,516
  • 19
  • 105
  • 165

1 Answers1

1

In order to open a pull request you'll need to "fork" the repo. You can do this from the GitHub web interface.

Once you've created a fork, you can add it as a remote for your local clone:

$ git remote add my-fork <uri-for-my-fork>

Then you can push your branch to your fork:

$ git push my-fork my-feature-branch

Then you'll be able to create a pull request from your branch on your fork into master on the original repo using the web interface.

GitHub provides detailed documentation here: https://help.github.com/articles/using-pull-requests/

Bo Borgerson
  • 1,386
  • 10
  • 20