查看当前所连接的仓库:git remote -v
取消与远程仓库的连接:git remote remove origin
新增分支:git branch 分支名字
切换分支:git checkout 分支名字
新增并切换分支:git checkout -b 分支名字
分支合并:git merge 分支名字
删除分支:git branch -d 分支名字
获取所有分支: git fetch
查看本地分支:git branch
查看远程分支:git branch -r
查看所有分支:git branch -al
前面带有remotes的分支都是远程分支,星号(*)表示当前所在分支。
更新远程分支到本地(本地有commit):git pull origin 分支名称 --rebase
撤销上一次add 里面的全部内容:git reset HEAD