如何为 Mercurial 用户创建别名?
我正在寻找一种方法为已提交到 Mercurial 存储库的用户创建别名。例如,如果有一个名为 user1 的用户,我希望他所做的每次提交都以 user2 的名称进行。
I am looking for a way to create an alias for a user that has commited to a mercurial repository. For example, if there is a user named user1 I'd like every commit done by him to be under the name user2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在谈论更改已用于某些提交的名称,则可以使用
hg Convert
来实现,源类型和目标类型为hg
以及>--authors
映射文件。但是,这样做时您会更改每个变更集的哈希值,如果有人已经克隆了您的存储库,您将对其进行管理。如果您正在谈论即将到来的提交,那么只需使用
hg commit
的-u
选项将它们设置为您想要的任何内容即可。If you're talking about changing the name that was already used for some commits, you can do that using
hg convert
with a source and destination type ofhg
and a--authors
mapping file. However, in doing so you change the hash of every changeset, and if anyone has already cloned your repo you'll be hosing them.If you're talking about commits to come, then just make them whatever you want using the
-u
option tohg commit
.