Github: Import upstream branch into fork

后端 未结 6 462
攒了一身酷
攒了一身酷 2020-12-07 07:24

I have a fork (origin) from a project (upstream) on github. Now the upstream project has added a new branch, I want to import into my fork. How do

6条回答
  •  暖寄归人
    2020-12-07 07:37

    I had trouble with this too, and google took me here. The solutions didn't work however. My problem was that when i added my upstream, it set up my git config to only fetch master, rather than all branches. e.g. It looked like this

    [remote "somebody"]
            url = git@github.com:somebodys/repo.git
            fetch = +refs/heads/master:refs/remotes/upstream/master
    

    Editing .git/config as follows fixed my problem

    [remote "somebody"]
            url = git@github.com:somebodys/repo.git
            fetch = +refs/heads/*:refs/remotes/upstream/*
    

提交回复
热议问题