删除/“变基”轨道迁移

发布于 2024-09-10 07:42:47 字数 165 浏览 1 评论 0原文

我一直在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等往事风中吹 2024-09-17 07:42:47

假设您非常清楚要做什么以及如何做,那么应该没有问题。

但是,你应该问自己为什么要这样做?它不会添加到您的项目中。它仅掩盖(部分)您的迭代,这可能会方便您稍后回顾以了解您的工作流程或向其他人解释它。

就我个人而言,我只会将您的分支与主分支合并,而不删除任何更改。没什么可羞耻的吧?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文