- git clone addr [local name] :建立本地仓库
addr:远程仓库地址(ssh://, http(s)://, git://)
local name :本地仓库名字,缺省时,默认为远程仓库名
- git branch :查看本地分支:当前所在分支前有*号标示
#git branch * master
Mercy_liu_dev_0
- git branch [name] : 新建本地分支,不切换
#git branch Mercy_liu_dev_1 * master Mercy_liu_dev_0 Mercy_liu_dev_1
- git branch -r :查看远程分支
#git branch -r origin/HEAD -> origin/master origin/master origin/Mercy_liu_dev_0 origin/Mercy_liu_dev_1
- git branch -a :查看本地分支和远程分支
#git branch * Mercy_liu master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/Mercy_liu_dev_0 remotes/origin/Mercy_liu_dev_1
- git branch -m | M oldbranch newbranch :分支重命名,如果newbranch已经存在,使用M强制转换。
#git branch -m Mercy_liu_dev_0 Mercy_liut_dev_2 #git branch * master Mercy_liu_dev_1 Mercy_liu_dev_2 #git branch -M Mercy_liu_dev_2 Mercy_liu_dev_1 #git branch * master Mercy_liu_dev_1
- git branch -d | D branch : 删除本地分支
#git branch -d Mercy_liu_dev_1 #gir branch * master
- git branch -d -r branch : 删除远程分支
git
https://www.maixj.net/ict/git-tag-23606
参考文章:
http://blog.csdn.net/xiruanliuwei/article/details/6919319