在 Mercurial 中,在“hg init”之后要创建项目并推送到服务器,如何使本地目录具有“hg path”服务器的?

发布于 2024-09-14 19:03:40 字数 774 浏览 1 评论 0原文

当使用 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 技术交流群。

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

发布评论

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

评论(1

霞映澄塘 2024-09-21 19:03:40

在这种情况下这是唯一的方法。还有很多其他情况,您必须手动编辑 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.)

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