如何从合并中忽略更改?

发布于 2024-11-19 23:01:43 字数 536 浏览 0 评论 0原文

我刚刚开始使用 git (git svn) 并导入 SVN 存储库。

我想要实现的目标:

我想要有 2 个分支,其中分支 A 将有一个项目,分支 A_dev 将有相同的项目,但经过调整的配置将允许我测试我的代码。所以我的开发将在 A_dev 中进行,然后我会将我的更改合并到 A(除了配置更改之外的所有更改)。

有没有办法让我对 A_dev 的配置更改忽略我将此分支进一步合并到 A 的操作?

到目前为止,我尝试使用

git merge -s ours <rev> A_dev

where rev is revision 其中配置更改已提交给 A_dev,它工作正常,直到我运行,

git svn rebase

然后配置更改应用到 A。

除此之外,我能想到的是仅在存储中进行配置更改并在每次结账 A_dev 时应用,这有点烦人。或者也许反过来做,在 A 上开发,然后合并到 A_dev,测试切换到 A 修复问题,这也不完全是这样。

I just started using git (git svn) and imported SVN repo.

What I'm trying to achieve:

I would like to have 2 branches where branch A would have a project, branch A_dev would have the same project, but with tweaked configuration that would allow me to test my code. So my development would happen in A_dev and then I would merge my changes to A (all but the configuration changes).

Is there a way I could have my configuration changes to A_dev ignored my further merges of this branch to A?

So far I tried using

git merge -s ours <rev> A_dev

where rev is revision where changes to configuration were committed to A_dev, which works fine until I run

git svn rebase

after which the configuration changes get applied to A.

Other than that what I could think of is to have configuration changes only in stash and apply each time I checkout A_dev, which is kind of annoying. Or maybe do it the other way around and develop on A and then merge to A_dev, test switch to A fix problem, which is also not quite it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

梦初启 2024-11-26 23:01:43

如果您的配置保存在独立文件中,您可以忽略该文件(那些文件)。有关详细信息,请参阅文档中的“.gitignore”文件或例如 此站点< /a>

If your configuration is saved in an isolated file, you may ignore this file (those files). See ".gitignore" file in the documentation for details or for example this site

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