如何修改Redmine中的存储库设置?

发布于 2024-07-18 01:25:14 字数 325 浏览 9 评论 0原文

这听起来可能是一个愚蠢的问题,但我一生都找不到这个问题的答案。

我们在 Redmine 中设置了一个项目并链接到 SVN 存储库。 一切工作正常,但我们最近进行了存储库搬迁,我们需要更新其 Redmine 存储库路径设置以指向新的存储库。

问题是该选项是灰色的,我无法更改它。 我想你可以点击“删除”并创建一个新的,但这个选项听起来确实很可怕(URL 中有 /destroy/ 这个词!!)而且我不想删除这个存储库。 我在Redmine手册中找不到关于此的参考资料。 我应该怎么办?

另外,与此相关的是,您是否知道旧提交中的所有票证引用是否仍然指向正确的位置?

It might sound like a dumb question but I can't for the life of me find the answer to this one.

We have a project set up in Redmine and linked to an SVN repository. Everything is working fine, but we recently did a repository relocation and we needed to update its Redmine repository path setting to point to the new repo.

The problem is that the option is grayed out and I can't change it. I suppose you could click on "Delete" and create a new one, but that option really sounds scary to try (the URL has the word /destroy/ in it!!) and I don't want to wipe out the repo. There's no reference I could find about this in the Redmine manual. What should I do?

Also --related to this-- do you know if all ticket references in old commits will still be pointing at the right places?

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

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

发布评论

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

评论(6

生死何惧 2024-07-25 01:25:14

好吧,我明白了。 我创建了一个虚拟项目,其中包含一个虚拟 svn 存储库来进行测试,最后单击了那个可怕的“删除”链接。 事实证明,它只删除对存储库的引用,而不是存储库本身。

这确实是一个愚蠢的问题,但这应该记录在Redmine手册中:)

Ok, I figured out. I created a dummy project with a dummy svn repo to test, and finally clicked that dreaded "Delete" link. It turns out it only deletes a reference to the repository, not the repo itself.

It was an admittedly dumb question, but this should be documented on the Redmine manual :)

回梦 2024-07-25 01:25:14

另一种选择是更改“存储库”表中的值。 在存储库搬迁的情况下它工作得很好。

Another option could be by changing the values in 'repository' table. It works pretty well in case of repository relocation.

笔芯 2024-07-25 01:25:14

另一种选择是更改“存储库”表中的值。 它在存储库重新定位的情况下工作得很好。

除非您确定它们完全相同,否则我不会推荐这样做。


PS我刚刚意识到这个问题有多老了,但我认为它仍然相关。

Another option could be by changing the values in 'repository' table. It works pretty well in case of repository relocation.

I wouldn't recommend this unless you know for sure that they are exactly the same.


P.S. I just realized how old this question is, but I think it's still relevant.

兲鉂ぱ嘚淚 2024-07-25 01:25:14

事实上,我只是被同样的愚蠢问题难住了。 谢谢。
然而,看起来包含对 redmine 中每个提交的引用的数据库信息被删除,然后也被重新创建。 如果您的存储库很大,这可能需要很长时间。 (如linux内核)

indeed, i just got stumped by the same dumb question. thanks.
however it looks like the database information containing references to each commit in redmine is removed and then recreated as well. this can take a long time if your repository is large. (like the linux kernel)

半暖夏伤 2024-07-25 01:25:14

这是在 Redmine 数据库上运行以更改存储库位置的 MySQL 查询:

UPDATE repositories SET url='/opt/git/NEW_LOCATION.git', root_url='/opt/git/NEW_LOCATION.git' WHERE url='/opt/git/OLD_LOCATION.git';

This is the MySQL query to run on the Redmine database to change the repository location:

UPDATE repositories SET url='/opt/git/NEW_LOCATION.git', root_url='/opt/git/NEW_LOCATION.git' WHERE url='/opt/git/OLD_LOCATION.git';
笑咖 2024-07-25 01:25:14

删除 redmine 中的存储库时要非常小心。 它不会删除您的物理存储库,但它会删除存储库的所有 redmine 存储,例如问题链接。 这些通常无法恢复(通过从重新定位的存储库导入),因为有些是手动创建的,在我的例子中,有些链接是很久以前使用提交注释中的另一种模式创建的。

重新定位存储库而不丢失链接数据的唯一方法是直接在数据库中更新 URL(它在“设置”页面中是只读的)。 例如,按照 dotancohen 的建议

UPDATE repositories SET url='newurl', root_url='newurlroot' WHERE url='oldurl';

Be very careful with deletion of repository in redmine. It does not delete your physical repository but it does delete all that redmine stores for the repository like links to issues. These often can not be restored (by import from relocated repository) because some are created manually and in my case some links were created long ago using another pattern in commit comment.

the only way to relocate repository without losing link data is to update the URL directly in database (it is read only in Settings page). for example as suggested by dotancohen

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