查看分支:git branch
创建分支:git branch
切换分支:git checkout 或者git switch
创建+切换分支:git checkout -b 或者git switch -c
合并某分支到当前分支:git merge
删除分支:git branch -d

将本地仓库把远程仓库覆盖

  1. git add .
  2. git commit -m "提交信息"
  3. git remote add origin http://仓库地址
  4. // 强制推送到远程仓库,且覆盖远程代码库
  5. git push -f --set-upstream origin master:master

创建的新分支推送创建远程分支

  1. git push origin newBranch:newBranch
  2. //git push <远程主机名> <本地分支名>:<远程分支名>