作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在使用 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/
我是一名优秀的程序员,十分优秀!