git checkout -b dev origin/dev
切换到dev分支上,接着跟远程的origin地址上的dev分支关联起来
D:\workspace\kevin-java>git checkout -b dev origin/dev
Switched to a new branch 'dev'
D .idea/runConfigurations.xml
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
D:\workspace\kevin-java>git branch -vv
* dev ff95a83 [origin/dev] 简单kafka的demo
master ff95a83 [origin/master] 简单kafka的demo
git checkout master
git branch -d dev
注意:-D是强制删除
D:\workspace\kevin-java>git checkout master
Switched to branch 'master'
D .idea/runConfigurations.xml
Your branch is up to date with 'origin/master'.
D:\workspace\kevin-java>git branch -d dev
Deleted branch dev (was ff95a83).
D:\workspace\kevin-java>git branch -vv
* master ff95a83 [origin/master] 简单kafka的demo
D:\workspace\kevin-java>git branch -vv
* dev ff95a83 [origin/dev] 简单kafka的demo
master ff95a83 [origin/master] 简单kafka的demo
D:\workspace\kevin-java>git branch -vv
* dev ff95a83 [origin/dev] 简单kafka的demo
master ff95a83 [origin/master] 简单kafka的demo
D:\workspace\kevin-java>git branch -vv -a
* dev ff95a83 [origin/dev] 简单kafka的demo
master ff95a83 [origin/master] 简单kafka的demo
remotes/origin/HEAD -> origin/master
remotes/origin/dev ff95a83 简单kafka的demo
remotes/origin/master ff95a83 简单kafka的demo