Git拉取远程分支到本地

栏目: 编程工具 · 发布时间: 6年前

内容简介:首先你得先查看你是否和远端的仓库建立连接。如果没有的话那就自行添加一下如果每天要提交代码 ,可以绕过上面这一步,直接切换分支

Git拉取远程分支到本地

拉取分支

首先你得先查看你是否和远端的仓库建立连接。

git remote -v

如果没有的话那就自行添加一下

git remote add origin  xxxx(你远程分支的git仓库地址)

如果每天要提交代码 ,可以绕过上面这一步,直接切换分支

git checkout -b Q3 origin/Q3

这个时候操作失败提示如下:

  • fatal: 'origin/Q3' is not a commit and a branch 'Q3' cannot be created from it

代表你本地没有Q3这个远程分支。

可以执行 git branch -r 来检查本地是否有Q3远程分支。

拉取远程分支到本地并切换分支。

git fetch origin Q3
git checkout -b Q3 origin/Q3

拉取远程分支到本地

git pull origin Q3

我的博客和github,喜欢就去点点星吧,谢谢。

https://github.com/lanpangzhi

http://blog.langpz.com

参考

https://curder.gitbooks.io/blog/git/remote_repository_pull.html


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Lean Startup

The Lean Startup

Eric Ries / Crown Business / 2011-9-13 / USD 26.00

更多中文介绍:http://huing.com Most startups fail. But many of those failures are preventable. The Lean Startup is a new approach being adopted across the globe, chan ging the way companies are built and ......一起来看看 《The Lean Startup》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具