删除/“变基”轨道迁移
我一直在 Rails 站点一部分的 git 分支工作。我在迭代时对架构进行了很多随机更改,并且进行了一些迁移来恢复以前的迁移以添加列和类似的内容。是否可以删除像这样的冗余迁移(即彼此相反的迁移对)?我不明白为什么它会引起任何问题,因为没有其他人在这个分支上工作,并且最终结果将是相同的。如果我继续这样做,会有麻烦吗?
I've been working in a git branch on one portion of a rails site. I've made a lot of random changes to the schema while iterating, and I've made some migrations that revert previous migrations to add columns and things like that. Is it OK to delete redundant migrations like those (i.e. pairs of migrations that are just reverses of each other)? I don't see why it would cause any problems because no one else is working on this branch, and the end result will be the same. Is there any chance of trouble if I go ahead with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您非常清楚要做什么以及如何做,那么应该没有问题。
但是,你应该问自己为什么要这样做?它不会添加到您的项目中。它仅掩盖(部分)您的迭代,这可能会方便您稍后回顾以了解您的工作流程或向其他人解释它。
就我个人而言,我只会将您的分支与主分支合并,而不删除任何更改。没什么可羞耻的吧?
There should be no problems, assuming you know perfectly good what to do and how to do it.
But, you should ask yourself why you want to do this? It is no addition to your project. It only masks (some of) your iterations, which might be convenient to look back later to understand your working process or to explain it to someone else.
Personally, I would just merge your branch with the main branch without deleting any changes at all. Nothing to be ashamed of right?