1、显示本地分支
$git branch

PS:*行显示的是当前分支,本地当前分支是master分支
2、创建本地分支
$git checkout -b topic

PS:git checkout -b topic命令在本地创建了一个topic分支并切换当前分支为topic
3、创建本地分支
$git push origin topic:topic

PS:git push origin topic:topic命令将本地的topic分支推到远程,在远程建立了一个topic分支
$ git pull <远程主机名> <远程分支名>:<本地分支名>
网友评论