首先你得先查看你是否和远端的仓库创建链接。html
git remote -v
若是没有的话那就自行添加一下git
git remote add origin xxxx(你远程分支的git仓库地址)
若是天天要提交代码 ,能够绕过上面这一步,直接切换分支github
git checkout -b Q3 origin/Q3
这个时候操做失败提示以下:fetch
表明你本地没有Q3这个远程分支。code
能够执行 git branch -r 来检查本地是否有Q3远程分支。
拉取远程分支到本地并切换分支。htm
git fetch origin Q3 git checkout -b Q3 origin/Q3
拉取远程分支到本地blog
git pull origin Q3
https://github.com/lanpangzhirem
https://curder.gitbooks.io/blog/git/remote_repository_pull.html博客