Git拉取遠程分支到本地

Git拉取遠程分支到本地

拉取分支

首先你得先查看你是否和遠端的倉庫創建鏈接。html

git remote -v
複製代碼

若是沒有的話那就自行添加一下git

git remote add origin  xxxx(你遠程分支的git倉庫地址)
複製代碼

若是天天要提交代碼 ,能夠繞過上面這一步,直接切換分支github

git checkout -b Q3 origin/Q3
複製代碼

這個時候操做失敗提示以下:bash

  • fatal: 'origin/Q3' is not a commit and a branch 'Q3' cannot be created from it 表明你本地沒有Q3這個遠程分支。

能夠執行 git branch -r 來檢查本地是否有Q3遠程分支。 拉取遠程分支到本地並切換分支。fetch

git fetch origin Q3
git checkout -b Q3 origin/Q3
複製代碼

拉取遠程分支到本地spa

git pull origin Q3
複製代碼

個人博客和github,喜歡就去點點星吧,謝謝。

github.com/lanpangzhicode

blog.langpz.comhtm

參考

curder.gitbooks.io/blog/git/re…blog

相關文章
相關標籤/搜索