git的强制覆盖本地代码修改 $ git fetch --all $ git reset --hard origin/master $ git pull针对与一个工程与远程仓库的连接,如果两端都有commit存在,此时可以将远程仓库先下载,然后将所有文件考入本地仓库替换掉本地的.git文件夹。