## 1、在当前分支下(一般是master分支),创建feature的本地分支分 $ git checkout -b feature Switched to a new branch 'feature' ## 2、将feature分支推送到远程 $ git push origin feature
Total 0 (delta 0), reused 0 (delta 0)
To code.aliyun.com:1273398724/test.git
* [new branch] feature -> feature
## 3、将本地分支feature关联到远程分支dev上 $ git branch --set-upstream-to=origin/feature Branch 'feature' set up to track remote branch 'feature' from 'origin'. ## 4、查看本地分支和远程分支的映射关系 $ git branch -vv
dev b87904a [origin/dev] test
* feature b87904a [origin/feature] test
master b87904a [origin/master] test
## 5、查看远程分支 $ git branch -r
origin/dev
origin/feature
origin/master
## 6、查看本地各个分支目前最新的提交 $ git branch -v
dev b87904a test
* feature b87904a test
master b87904a test
## 7、查看远程各个分支目前最新的提交 $ git branch -r -v
origin/dev b87904a test
origin/feature b87904a test
origin/master b87904a test