git 创建分支并提交代码

1、查看所有分支

git branch -a

2、查看当前分支

git branch

3、新建一个分支

git branch feature-xx

4、切换到新建分支上面

git checkout feature-xx

5、提交代码到本地缓存区

git add .

6、添加提交的代码备注

git commit -m "备注内容"

7、推送提交的代码到远程新建的分支上面

git push origin feature-xx

..........................................分割线................................................

删除远程分支

git push origin --delete feature-xx

删除本地分支

git branch -d feature-xx

猜你喜欢

转载自www.cnblogs.com/prettrywork/p/12143142.html