How do I push to a pull request on github?

后端 未结 4 920
我寻月下人不归
我寻月下人不归 2020-12-24 11:15

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

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

Which allows me to pull down pull

4条回答
  •  长情又很酷
    2020-12-24 11:45

    Good question. But I would be surprised if you could:

    $ cat .git/refs/pull/upstream/839 
    f8a9f492098e154b4a8258a941af47c9ca017ada
    

    Even if you can somehow change that reference to what you like, github has other metadata that you can't easily change. So better push to the branch pull was created from.

    $ git push git@github.com:owner/repo.git HEAD:target-branch
    

    See the github command line wrapper for easier github interaction from command line: https://hub.github.com/

    Update: You can push to an existing pull request if you push to the fork/branch that PR is based on. It is often possible depending on repo settings.

    git push git@github.com:username/repo-name.git localbranchname:remotebranchname
    

    or if you have the fork added as a remote in your local repo, then:

    git push remotename localbranchname:remotebranchname
    

提交回复
热议问题