用我的仓库覆盖远程git仓库

用我的仓库覆盖远程git仓库

本文介绍了用我的仓库覆盖远程git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

远程存储库包含错误的版本。我有本地好版本的副本。我想用我当前的仓库替换远程仓库中的所有东西(远程仓库有几个不应该发生的提交(包括合并))。



如果我试图推动它,它告诉我我需要先拉,但我不想这样做,因为这会搅乱我的本地版本。我希望远程仓库能够包含我在本地的货物。



我该如何做?

解决方案使用 - force ,Luke。




The remote repository contains a bad version. I have the copy of a good version locally. I want to replace everything that's on the remote repository with my current repository (the remote repository has a few more commits (including a merge) that should not have happened).

If I try to push, it tells me I need to pull first, but I don't want to do that, because that would mess my local version. I want the remote repo to contain what I have locally.

How can I do that?

解决方案

Use the --force, Luke.

http://www.kernel.org/pub/software/scm/git/docs/git-push.html

这篇关于用我的仓库覆盖远程git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 08:29