在 Mercurial 中,在“hg init”之后要创建项目并推送到服务器,如何使本地目录具有“hg path”服务器的?
当使用 now 启动项目
mkdir proj
cd proj
hg init
[create some files]
hg add file.txt
hg commit
hg push ssh://[email protected]/proj
并发出 hg path
时,不会显示任何内容。我们如何实际更改存储库,使其就像从 [电子邮件受保护]/proj
?是否只是通过编辑 .hg/hgrc 并添加,
[paths]
default = ssh://[email protected]/proj
因为感觉操作级别太低(通过编辑文本文件)
When a project is started with
mkdir proj
cd proj
hg init
[create some files]
hg add file.txt
hg commit
hg push ssh://[email protected]/proj
now when hg path
is issued, nothing will show. How do we actually change the repository so that it is as if it is cloned from [email protected]/proj
? Is it just by editing .hg/hgrc and adding
[paths]
default = ssh://[email protected]/proj
because that feels like too low level an operation to do (by editing a text file)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下这是唯一的方法。还有很多其他情况,您必须手动编辑
hgrc
,例如设置挂钩或启用扩展,因此这并不罕见。(您可能已经知道,
hg clone
会将克隆中的路径条目设置为指向原始版本。)It's the only way to do it in this situation. There are plenty of other cases where you have to edit the
hgrc
by hand, like setting up hooks or enabling extensions, so it's not as if it's unusual.(As you probably already know,
hg clone
will set the path entry in the clone to point back to the original.)