GitHub keeps saying “This branch is X commits ahead, Y commits behind”

前端 未结 3 1622
死守一世寂寞
死守一世寂寞 2020-12-12 10:22

I know there are several similar questions, but I think my situation is a little bit different.

Let\'s say there is a GitHub repository which I want to contribute to

3条回答
  •  难免孤独
    2020-12-12 11:20

    I have the same problem with you and just solved this problem.

    To solve this:

    1. 'Reset' your local repo to the moment before the abundant commits

    2. Create a new branch using this amended local repo

    3. 'Publish' this amended local repo to your github repo

    4. Make the changes that you want to PR to github in the amended local repo

    5. 'Commit' this local repo

    6. 'Pull' the commit to your github repo

    7. On your github repo new branch, submit pull request to the upstream repo

    Hope this answer could help.

提交回复
热议问题