1.克隆项目到本地
git clone git@git.oschina.net:xxx/xxx.git
或者
git clone https://git.oschina.net/xxx/xxx.git
2.查看本地分支
git branch
* br-2.1.2.2
master
3.查看所有分支(包括远程)
git branch -a
* br-2.1.2.2
master
remotes/origin/HEAD -> origin/master
remotes/origin/br-2.1.2.1
remotes/origin/br-2.1.2.2
remotes/origin/br-2.1.3
remotes/origin/master
4.创建分支
git branch dev_master
git branch
* br-2.1.2.2
master
dev_master
5.切换分支
git checkout dev_master
git branch
* dev_master
br-2.1.2.2
master
6.把分支推到远程分支
git push origin dev_master
7.删除本地分支
git branch -d dev_master
8.删除远程分支
git push origin --delete <branchName>
或者
git push origin :<branchName>
9.获取远程tag
git fetch origin tag <tagname>