当某个xx执行了 git push --force
之后
本地仓库也是不需要那些个提交记录了,强推已经改写了提交历史,直接 pull 可能会有冲突。
强推操作本该是不被允许的,然而 Only paid enterprise are available
,没辙,所以 using theirs。
丢弃本地所有提交记录,这些提交记录会从历史日志中彻底消失,不再合并文件、处理可能的冲突。那就这样做:
# fetch from the default remote, origin
git fetch
# reset your current branch (master) to origin's master
git reset --hard origin/master
参考:Resolve conflicts using remote changes when pulling from Git remote1。
References
- https://stackoverflow.com/a/4787356.