如何在Git中对master进行紧急修复? [英] How to do emergency fixes on master in git?

查看:114
本文介绍了如何在Git中对master进行紧急修复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了一些改变(r5,6,7,8)来掌握并推动起源。其他人拉了。现在主人应该在2天内部署,但是有紧急情况需要今天出去。最佳做法是什么?我是否从r4创建一个新的分支并部署该分支,然后将此分支合并到master? IRC上有人说暂时还原它们,然后提交,然后解除它们,但我试图理解这将如何更好或如何工作。

div>


IRC上的某个人说暂时还原他们,提交,然后将他们还原,但我试图理解这将如何更好或如何工作。

这会创造一个非常难看的历史:r4-r5-r6-r7-r8-fix -x8-x7-x6-x5-fix-r5-r6-r7-r8。



关闭r4创建分支是最佳解决方案。无论如何,你应该有一个生产分支,这个分支没有更新,除非有东西被部署到生产环境中。


I have committed some changes (r5,6,7,8) to master and pushed to origin. Other people have pulled. Now master is supposed to be deployed in 2 days, but there is an emergency and something needs to go out today. What's the best practice for this? Do I create a new branch off of r4 and deploy that branch and then merge this branch into master? Someone on IRC said to temporarily revert them, commit, then unrevert them, but am trying to grasp how this would be better or how this works.

解决方案

Someone on IRC said to temporarily revert them, commit, then unrevert them, but am trying to grasp how this would be better or how this works.

This would create an extremely ugly history: Instead of r4-r5-r6-r7-r8-fix your history would look like r4-r5-r6-r7-r8-x8-x7-x6-x5-fix-r5-r6-r7-r8 after all the changes.

Creating a branch off "r4" is the best solution. You should have a production branch anyway that is not updated unless something is deployed to production...

这篇关于如何在Git中对master进行紧急修复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆