Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github: Pushing to pull requests

I'm about to pull my hair out.

I've submitted a pull request from my fork of a project, back to the owner/maintainer's repo. In this pull request, some things came up that I had to add/change based on new information. I've made said changes, and now I'm trying to PUSH to that pull request.

According to Github's "issue" page, at the bottom, it says I can push commits directly to the issue (pull request) by pushing to branch abc123 on my fork of the repository.

The problem is, when i do git push origin abc123 I get the error:

fatal: 5fa087b35cb8379f282174df2f4197ba258ffd05 cannot be resolved to branch.

I'm not sure how to fix this. Should I just close the pull request and re-submit? Or is there something I'm doing wrong, or more than I need to do?

Thanks.

like image 872
Jim Rubenstein Avatar asked Dec 12 '11 19:12

Jim Rubenstein


People also ask

Do you push before pull request?

Always Pull Before a Push This is a bedrock rule. Before you try to push code out to the repository, you should always pull all the current changes from the remote repository to your local machine. Doing so will ensure that your local copy is in sync with the remote repository.

What is the difference between pushing and pulling in GitHub?

Push sends commits and asks them to update their branch. This requires that things be right on their end. This cannot combine parallel development. Pull gets commits and has your Git update your remote-tracking name, then runs a second Git command to update your branch.

How do I force pull request GitHub?

Creating the pull request. On GitHub.com, navigate to the main page of the repository. In the "Branch" menu, choose the branch that contains your commits. Above the list of files, click Pull request.


1 Answers

It is actually (from GitHub Remotes help page)

git push REMOTENAME LOCALBRANCHNAME:REMOTEBRANCHNAME

You did not:

  • create a local branch 'abc123'
  • specify a local branch name

So, what should work is (if you are on master branch for instance):

git push origin master:abc123

Generally, the default push policy is "matching": git push origin abc123 would try to push a local branch named abc123 to a remote branch with the same name.

like image 142
VonC Avatar answered Nov 15 '22 23:11

VonC