How to modify Github pull request?

前端 未结 4 1247
星月不相逢
星月不相逢 2020-12-07 11:52

I\'ve opened a pull request to a project. The maintainer has decided to accept it, but told me to modify some contents.

How can I do it? Whether I should keep the c

4条回答
  •  不知归路
    2020-12-07 12:22

    I just had one commit in a pull request, and I used git commit --amend to update it. I then did a force push with git push -f so my amended commit replaced the original one. The pull request automatically picked up the new commit. (It actually showed both commits, but when I reloaded the page the old commit had gone.)

    So while a forced push is generally not recommended, it can be useful for pull requests. It's not recommended because if someone bases a commit on top of yours then they will have to do a rebase after your change. But since nobody should be basing their work on an under-review pull request, it should be pretty safe in this situation.

提交回复
热议问题