用到过的git命令

查看远程分支,远程分支会用红色表示出来

git branch -a

从远程获取代码并合并本地的版本

git pull

查看仓库当前的状态,显示有变更的文件

git status 

一次完整的提交代码

git pull
git commit -m '注释'
git push 

git拉取到本地强制覆盖

$ git fetch --all
$ git reset --hard origin/master 
$ git pull

切换分支

查看分支

 $git branch -a
* master
  uar
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/uat

进行切换

git checkout -b uat origin/uat
原文地址:https://www.cnblogs.com/alwayszzj/p/14041273.html