Git拉取远程分支到本地

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

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

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


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

查看所有标签

猜你喜欢:

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

Speed Up Your Site

Speed Up Your Site

Andrew B. King / New Riders Press / 2003-01-14 / USD 39.99

There's a time bomb on the web: user patience. It starts ticking each time someone opens one of your pages. You only have a few seconds to get compelling content onto the screen. Fail, and you can kis......一起来看看 《Speed Up Your Site》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具