Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github: Push additional commit to pull request

I made a pull request, but now I need to push an additional commit to this pull request. Github says that:

You can add more commits to this pull request by pushing to the x4e925e4 branch on myaccount/repo.

How do I achieve this via the command line?

like image 310
Tom Avatar asked May 20 '12 09:05

Tom


People also ask

How do I push changes to an existing pull request?

To make changes to an existing pull request, make the changes to your local branch, add a new commit with those changes, and push those to your fork. GitHub will automatically update the pull request.

Can a pull request have multiple commits?

Yes, it will. This includes merge commits, by the way, so if a different branch than the target branch of the pull request is merged in to the branch, then the merge commit and both of its parent chains of commits (from both branches) will become part of the PR.

Can I commit to a pull request?

You can commit changes on a pull request branch that was created from a fork of your repository with permission from the pull request creator. You can only make commits on pull request branches that: are opened in a repository that you have push access to and that were created from a fork of that repository.

How do I push a commit to someone else branch?

Push Branch to Another Branch In some cases, you may want to push your changes to another branch on the remote repository. In order to push your branch to another remote branch, use the “git push” command and specify the remote name, the name of your local branch as the name of the remote branch.


1 Answers

git push origin master:x4e925e4

If you want to push from another branch, just change the "master" bit.

Once the pull request is done, if this branch is not automatically deleted, you can delete it with:

git push origin :x4e925e4
like image 98
Artefact2 Avatar answered Oct 14 '22 15:10

Artefact2