git拉取远程分支到本地
step1:新建一个空文件夹,名wuliu
step2:初始化git
git init
step3:与远程仓库建立连接
git remote add origin http://git.xxx.com:10001/root/vue-upms.git
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191008132344130.png
step4:把远程分支拉到本地
git fetch origin wuliu
其中,wuliu为远程仓库的分支名
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191008133027598.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3l5bmlra2k=,size_16,color_FFFFFF,t_70
step5:在本地创建分支wuliu并切换到该分支,与远程分支映射
git checkout -b wuliu origin/wuliu
git checkout -b dev(本地分支名称) origin/dev(远程分支名称)
step6:拉取分支上的内容确认已到本地
git pull origin wuliu
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191008133817613.png
Already up to date! 返回本地文件夹里面看都在里面啦,完成!
附:下拉更新、上传提交基本操作
以master分支为例
//下拉更新(修改代码之前就应该先pull)
git pull origin master
//查看文件状态
git status
//添加所有文件到暂存区
git add .
//添加单个文件
git add file1
//添加多个文件,文件之间以空格隔开
git add file1 file2 file3
//将缓存中的文件Commit到git库
git commit -m 添加你的注释
//撤销commit(仅仅撤销commit操作,代码任然保留)
git reset --soft HEAD^
//提交远程仓库
git push origin master
//查看仓库所有提交状态
git log
备忘