TortoiseHG - 更改之前提交的用户名?
我对 HG 还很陌生,当我最初设置它时,我没有为本地存储库设置我的用户名。我的提交显示当前登录的用户和计算机名称。即adam@mypc
,设置我的用户名后,我现在有了adam
。
我想知道是否可以将之前的提交更改为显示 adam@mypc
以显示 adam
。
我有多台电脑工作,我想将所有提交保留在同一用户名下。
提前致谢。
I am pretty new to HG and when I initially set it up I didn't setup my username for my local repositories. My commits display the current logged in user and machine name. i.e. adam@mypc
and after setting my username I now have adam
.
I would like to know if it is possible to change the previous commits that say adam@mypc
to display adam
.
I have multiple PCs that I work from and I'd like to keep all of the commits under the same username.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提交者的名称不是在推送时设置的,而是在提交时设置的,并且它是变更集本身不可更改的部分。您可以使用新名称重写变更集(最简单的方法是使用带有
--authormap
的convert
命令),但它会更改这些变更集的哈希值并使任何克隆无效在那里。今后,您可以将该值设置为~/.hgrc
文件的[ui]
部分中的username
,以确保它们是所有机器上都是一样的。The name of the committer isn't set at push time, it's set at commit time, and it's an unchangeable part of the changeset itself. You could re-write the changesets with new names (easiest would be using the
convert
command with an--authormap
) but it will change hashes of those changesets and invalidate any clones out there. Going forward you can set that value as theusername
in the[ui]
section of your~/.hgrc
file to make sure they're the same across all your machines.