Adding commits to another person's pull request on GitHub

前端 未结 4 1175
执笔经年
执笔经年 2021-01-30 13:14

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 som

相关标签:
4条回答
  • 2021-01-30 13:41

    Not unless barryceelen gives you push access to his fork. You'll have to close his pull request and open a new one from your branch that includes his commits.

    Not being able to do what you want to do is annoying. To make better use of GitHub flow, I'd suggest asking forkers to open issues separately from their pull requests that solve them, meaning you can keep the initial conversation flow and have it closed by whatever pull request you decide as the best.

    0 讨论(0)
  • 2021-01-30 13:52

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

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

    git push git@github.com: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.

    0 讨论(0)
  • 2021-01-30 13:57

    It is possible to do this now (link)

    Suppose you have received a pull request in yourrepo from otheruser.

    Add the other user as a remote

    git remote add otheruser https://github.com/otheruser/yourrepo.git
    

    Fetch

    git fetch otheruser
    

    Create a branch from their repo

    git checkout -b otheruser-master otheruser/master 
    

    Now make some changes and commit. Push to their repo

    git push otheruser HEAD:master
    
    0 讨论(0)
  • 2021-01-30 13:59

    I use the new gh cli tool.

    gh pr checkout PR_NUMBER
    

    Then make your changes and as long as you have access to push to their fork (which from my experience is usually the case if you own the primary repo). With using the gh tool, it will basically copy their branch's name so you can do.

    git push git@github.com:other_user/repo branch:branch
    
    0 讨论(0)
提交回复
热议问题