Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
249 views
in Technique[技术] by (71.8m points)

git - Adding commits to another person's pull request on GitHub

My project on GitHub has received a pull request. The pull request only partly fixes the issue that it's addressing. I've pulled in the changes to a local branch and added some commits of my own.

I'd now like to push those commits back to my remote repo and have them show up on the pull request, but without merging them into the target branch. I'd like to keep the pull request open for further review and discussion, and potentially further commits.

Is there a way I can add commits to the pull request without merging them into the target branch and therefore closing the pull request?

question from:https://stackoverflow.com/questions/20928727/adding-commits-to-another-persons-pull-request-on-github

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As long as the original author has clicked the checkbox in the bottom right:

Allow Maintainers

If that box is checked, then you can push back to the original branch without needing to add a remote by using:

git push [email protected]:user/repo local_branch_name:remote_branch_name

This is particularly useful if you're using a tool like hub where you can check out a pull request without needing to add a remote.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...