search

Home  >  Q&A  >  body text

git - pull request problem, as shown below

怪我咯怪我咯2794 days ago567

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-05-02 09:36:26

    The reason for this is that the remote code is updated during the development process of your local code.

    It’s very simple, all you need to do is rebase the code.

    Before doing the following operations, first check the pointing of your local remote. If you fork, there should be another origin pointing to your own github. You need to add a remote pointing to the source code first. Do this:
    git remote add upstream *URL*
    where URL is the address of the source code.

    Then get the latest HEAD pointer of the remote code (in fact, this command is not only used to get the upstream, but also the origin): git fetch --allgit fetch --all
    然后确保你是在working branch上,运行git rebase upstream/masterThen make sure you are on the working branch and run git rebase upstream/master

    Conflicts will appear at this time. Generally, you modified a file locally and remotely at the same time, and git doesn't know which one to use. Use git status查看哪些文件出了问题,做一下更改就好。然后git add .git rebase --continue.

    After modification, when git push到你的origin working branch,有可能需要git push -f。特别是当你用了git rebase -i, this command can be used to squash commit.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-02 09:36:26

    Didn’t I give you all the tips? It says that conflicts between branches need to be resolved!

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-02 09:36:26

    I create a new branch for development in the warehouse I forked, so the code I pulled has no conflicts, but my code is not the latest. When I compare the pull request with the main code library, I can’t get in.

    reply
    0
  • Cancelreply