Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I push to a pull request on github?

I've added this to my .git/config file:

fetch = +refs/pull/*/head:refs/remotes/origin/pr/* 

Which allows me to pull down pull request diffs, but when I check it out it actually creates a branch with that same name. Is there any way for me to push to pr/2 and have it actually go to the pull request instead of going to a new branch named pr/2?

like image 672
lobati Avatar asked Mar 20 '13 17:03

lobati


People also ask

Can I push after pull request?

Once you've created a pull request, you can push commits from your topic branch to add them to your existing pull request. These commits will appear in chronological order within your pull request and the changes will be visible in the "Files changed" tab.

How do I add files to a pull request?

To attach a file to an issue or pull request conversation, drag and drop it into the comment box. Alternatively, you can click the bar at the bottom of the comment box to browse, select, and add a file from your computer. Tip: In many browsers, you can copy-and-paste images directly into the box.

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.


1 Answers

A Pull Request is just a request to merge a certain branch. This means commits made to the branch after the pull request is opened will be included in the eventual merge.

If you have access to the branch that the pull request is asking to merge, you can commit to that branch and the pull request will update with the changes.

Example:

pull/3 is requesting to merge hotfix into master

git fetch git checkout hotfix git pull origin hotfix 

make changes

git add . git commit -m "changes!" git push origin hotfix 

Now your commit will show up in the pull request.

like image 113
Ross Avatar answered Oct 12 '22 01:10

Ross