gpt4 book ai didi

git - 如何在 git 中使用覆盖选项将一个分支 merge 到另一个分支

转载 作者:太空狗 更新时间:2023-10-29 14:16:17 25 4
gpt4 key购买 nike

我正在使用 git,我有两个分支:production 和 master。此时生产已有 9 个月大,许多更改已进入 master 分支。

我正在使用 capistrano,所以我需要将所有更改推送到生产分支,以便我可以部署。但是,当我 merge 时,我遇到了大量的 merge 冲突。我不关心 merge 问题,因为我希望我的生产分支被主分支覆盖。有办法吗?

如果不是,我正在考虑创建一个名为 production_old 的生产分支。然后删除生产分支中的所有内容,然后从主分支中 merge 。

我正在使用 github。

最佳答案

也许是 ours merge 策略就是您要找的。

ours This resolves any number of heads, but the resulting tree of the merge is always that of the current branch head, effectively ignoring all changes from all other branches. It is meant to be used to supersede old development history of side branches.

更多... http://www.kernel.org/pub/software/scm/git/docs/git-merge.html

关于git - 如何在 git 中使用覆盖选项将一个分支 merge 到另一个分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1922336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com