如果需要丢弃本地的一些修改,强制更新到服务器的最新版本,可以使用以下命令:
1、先查看当前分支
$ git branch
* master
2、git fetch
$ git fetch --all
3、强制设置当前分支,因为是master分支,所以,强制更新到远程的master分支
$ git reset --hard origin/master
这样强制更新以后,本地分支,会与远端仓库的最新版本保持一致
如果需要丢弃本地的一些修改,强制更新到服务器的最新版本,可以使用以下命令:
1、先查看当前分支
$ git branch
* master
2、git fetch
$ git fetch --all
3、强制设置当前分支,因为是master分支,所以,强制更新到远程的master分支
$ git reset --hard origin/master
这样强制更新以后,本地分支,会与远端仓库的最新版本保持一致