因为开发环境有区别,同事和我安装的包也有区别,不小心把他的apache4php这个包删除了,后面线上支付出了问题,后面就有点混乱了,然后今早拉取最新代码的时候就出现如题那个错误,说我的本地和远程分叉了,我本地还比远程多4个commit,本想把远程的拉下来然后手动解决冲突的,发现一拉就报错,

$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 3 and 4 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean

根据提示说把远程拉下来和我本地合并,完全不管用。没办法,只能用远程覆盖本地的了,命令如下:

注意了,这个操作会覆盖本地的修改,因此建议手动备份!一定要备份!可以查看一下本地和远程现在有区别的有哪些文件,针对性的备份。

git fetch origin
git reset --hard origin/master
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐