git 克隆指定分支
git clone -b 分支名 仓库地址
例如:
bash
git clone -b dev https://gitee.com/UserGuan/spring-boot-demo.git
git 给仓库添加新分支并上传代码
1、初始化仓库
bash
git init

2、创建分支并命名
bash
git checkout -b 分支名
例如:
bash
git checkout -b v2

3、将文件提交至暂存区
① 提交文件
提交文件夹下的所有文件
bash
git add *
提交文件夹下的指定文件
bash
git add 文件名

② 填写备注信息
bash
git commit -m 本次提交的备注信息

4、与远程仓库建立连接
bash
git remote add origin 你的SSH地址

5、将文件提交至分支仓库
bash
git push origin 刚刚创建的分支仓库名字

6、提交成功
提交成功后,在你的 gitee 上刷新页面,即可看见已经添加的分支仓库
