一个远程分支到另一个分支

一个远程分支到另一个分支

本文介绍了我如何覆盖,而不是合并,一个远程分支到另一个分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个分支。分期和Beta。分期中有代码(包括文件),我根本不需要。我怎样才能让Beta完全覆盖Staging,以便这些文件或代码都不会从Staging合并到Beta中。



我看到一些人推荐这样做:

  git checkout staging 
git merge -s我们的beta

但我不相信预先存在的文件会成为代码冲突,因此不会被删除。我错了吗?如果我是对的,我该怎么做到这一点?

解决方案

您可以简单地删除 code>并根据 beta 重新创建它:

  git branch -D staging 
git checkout beta
git branch staging


I have two branches. Staging and Beta. Staging has code in it ( including files ), that I do not want at all. How can I make Beta completely overwrite Staging, so that none of those files or code are merged from Staging into Beta.

I see some people recommend doing this :

git checkout staging
git merge -s ours beta

But I don't believe the pre-existing files would be a "code conflict" and therefore would not be removed. Am I wrong? If I'm right, how would I accomplish this?

解决方案

You can simple delete staging and re-create it based on beta:

git branch -D staging
git checkout beta
git branch staging

这篇关于我如何覆盖,而不是合并,一个远程分支到另一个分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 20:04