GitHub pull request showing commits that are already in target branch

前端 未结 11 1201
孤城傲影
孤城傲影 2020-12-12 09:29

I\'m trying to review a pull request on GitHub to a branch that isn\'t master. The target branch was behind master and the pull request showed commits from master, so I merg

11条回答
  •  清歌不尽
    2020-12-12 10:20

    I'm not exactly sure about the theory behind this. But I got this several times and able to fix this by doing the following.

    git pull --rebase
    

    This will fetch and merge the changes from your original repo master branch (If you have point to that)

    Then you push your changes forcefully to your github cloned repository (target)

    git push -f origin master
    

    This will make sure your github clone and the your parent repo are at the same github commit level and you don't see any unnecessary changes across branches.

提交回复
热议问题