git pull displays “fatal: Couldn't find remote ref refs/heads/xxxx” and hangs up

前端 未结 9 899
醉话见心
醉话见心 2021-01-31 06:58

I created a branch called \'6796\', then I pushed it to remote, checked it out on another machine, made other edits, pushed it, then merged it with the master, and deleted it -

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 07:25

    To pull a remote branch locally, I do the following:

    git checkout -b branchname // creates a local branch with the same name and checks out on it

    git pull origin branchname // pulls the remote one onto your local one

    The only time I did this and it didn't work, I deleted the repo, cloned it again and repeated the above 2 steps; it worked.

提交回复
热议问题