如何在 Mercurial 中按存储库设置不同的用户名?

发布于 2024-08-05 08:58:22 字数 81 浏览 3 评论 0原文

我正在使用 Mercurial 作为 VCS 为不同的客户开发项目。我知道如何设置默认用户,但是有没有办法为每个项目设置不同用户?

I am working on projects for different clients using Mercurial as a VCS. I know how to set a default user, but is there a mean to set a different user for each project ?

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

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

发布评论

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

评论(2

愚人国度 2024-08-12 08:58:22

只需编辑每个存储库内的文件 .hg/hgrc 即可。它与您的 ~/.hgrc 语法相同,但只会影响特定的存储库。

repo1/.hg/hgrc中:

[ui]
username = Foo Bar <[email protected]>

repo2/.hg/hgrc中:

[ui]
username = Something Else <[email protected]>

Just edit the file .hg/hgrc inside each repository. It's the same syntax as your ~/.hgrc but will only affect a specific repo.

In repo1/.hg/hgrc:

[ui]
username = Foo Bar <[email protected]>

And in repo2/.hg/hgrc:

[ui]
username = Something Else <[email protected]>
抠脚大汉 2024-08-12 08:58:22

除了为每个存储库设置用户名之外,您还可以使用 Mercurial 动态用户名 扩展并为全局 ~/.hgrc 中的特定位置设置用户名,如下所示:

[extensions]
dynamic_username =

[dynamic_username]
work.location = ~/work
work.username = John Smith <[email protected]>
hobby.location = ~/hobby ~/blogging
hobby.username = Johny <[email protected]>

Alternatively to setting username for each repository you can use Mercurial Dynamic Username extension and set usernames for specific locations in your global ~/.hgrc like this:

[extensions]
dynamic_username =

[dynamic_username]
work.location = ~/work
work.username = John Smith <[email protected]>
hobby.location = ~/hobby ~/blogging
hobby.username = Johny <[email protected]>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文