How to modify Github pull request?

前端 未结 4 1246
星月不相逢
星月不相逢 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:29

    If you continue to make changes and keep pushing to the same branch, the refined commits will be added to the same pull request (unless your pull request has been merged). This could make the history very cluttered.

    An alternate solution and a technique that I use is as follows:

    1. Create a new branch (fixes) from the repository(upstream) and branch (develop) to which you intend to send the pull request by doing:

      git branch fixes upstream/develop

    2. Add your refined commits directly to this newly created branch.

      git commit -m "your message"

    3. Push this branch to your own forked remote (could be named origin).

    4. Compare and send in a new pull request with clean commit history.
    5. Also, it is a good idea to delete your branch after the pull request has been merged.
    6. And you can comment and close your earlier pull requests.

提交回复
热议问题