Search code examples
gitgithubpull-requestgit-remotegit-fork

Creating a pull request to a repository I can push to


Another git pull request question, but I looked at a lot of them and none answered my question.

I had a branch, say A, of a github repo I am a contributor for and have push rights to, on my machine. I forked and created a pull request for A in the repo and then added and committed more changes to this branch locally.

Now I want to create another pull request for these changes; however, the commits are only saved locally. I want to push to a remote, but

git remote -v

returns

origin   https://github.com/some_user/repo_a (fetch)
origin   https://github.com/some_user/repo_a (push)
upstream https://github.com/some_user/repo_a (fetch)
upstream https://github.com/some_user/repo_a (push)

All the links are to the main repo. I looked at my list of repositories and there is no copy of the repo there. So, I cannot change the origin or the upstream to something else.

As I said, I want to push the new changes and create a pull request, but I can't get it done.


Solution

  • The problem was I didn't have a remote fork to start with. I went to the REPO and clicked on 'fork this repo' on the top right. This created a copy of the repo on my account, which gave me a link to push to.

    After changing the upstream to this link, I could push to this repo, and create a pull request from it.