首先通过
git branch -a
来查看所在目录的分支
1 $ git branch -a 2 * dev 3 master 4 remotes/origin/HEAD -> origin/master 5 remotes/origin/dev 6 remotes/origin/master
切换本地分支
git checkout -b master
切换远程分支
git checkout -b dev origin/dev
删除本地分支
git branch -d dev
删除远程分支
git push origin --delete <BranchName>
注:远程分支需谨慎删除;