英文:
git pull -f not overwriting local files
问题
但是当我执行git pull(带有或不带有-f)时,会收到多个合并冲突的消息
我只想用远程的内容覆盖本地的分支(因为推送是由一个不专业的开发人员完成的,我已成功覆盖,但是这个服务器无法强制拉取)。我该怎么做?
英文:
I have a weird situation where I have no uncommitted changes locally:
But when I do a git pull(With or without -f) I get message of several merge conflicts
I just want to overwrite the local stage branch(of live server) with that in remote(as the push was done by a unprofessional dev which I have overwritten succesfully but this server somehow is not able to force pull). How do I do it?
答案1
得分: 2
只需在本地的stage分支(生产服务器的分支)上覆盖远程的操作。如何操作呢?
本地执行以下命令:
git fetch
git switch -C stage origin/stage
英文:
> I just want to overwrite the local stage branch(of live server) with that in remote ... How do I do it?
Locally, say:
git fetch
git switch -C stage origin/stage
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论