git开发中常用命令

项目代码克隆岛本地

git clone 项目地址
#如:git clone http://cngit.fir.ai/data_service/distributedstorage.git

克隆指定分支的代码

git clone -b 分支名 项目url  
#如:git clone -b fastdfs-dev http://cngit.fir.ai/data_service/distributedstorage.git

查看当前项目所在的分支

git branch     #查看本地分支
#(storage) shl@shl-pc:~/distributedstorage$ git branch
#* fastdfs-dev

git branch -a   #查看远程分支

项目切换到指定的分支

git checkout -b v1 origin/v1

切换回master分支

git checkout master

猜你喜欢

转载自www.cnblogs.com/sui776265233/p/10821310.html