今天在用git创建分支的时候想记录一下常用的git命令,方便日后查询。
一,查看本地分支
git branch
图 一
二,查看远程分支
git branch -a
图 二
三,建立本地分支
git branch test(新建分支名)
图 三
图 四
四,将本地分支push到远程上
git push origin test(新建分支名)
图 五
五,切换到新建分支(test分支)
git checkout test(新建分支名)
图 六
图 七
图 八
六,删除本地分支
git branch -d test(新建分支名)
图 九
图 十
七,删除远程分支
git push origin :test
图 十一