git 常用命令

1,git拉去远程分支到本地
  • dev为远程分支名
  git fetch origin dev
  git checkout -b dev origin/dev 
2,push强制覆盖远程分支
  git push  origin master --force`` 
  git push -f origin master
3,pull强制覆盖本地
  git fetch --all
  git reset --hard origin/master
  git pull
4,强制回退到指定版本
  git reset  '434468d407a520bd264218a2258bf50f42f03e68 [434468d]' --hard
原文地址:https://www.cnblogs.com/guligei/p/11264350.html