hg clone
设置默认路径,这样就可以不用每次指定url就可以pull和push。
hg clone ssh://hg@bitbucket.org/account/repository
但是,如果您有一个现有的本地存储库并决定在 bitbucket 上共享它,您将无法获得默认路径设置。
hg push ssh://hg@bitbucket.org/account/repository
是否有设置默认路径的命令,或者我是否被迫手动编辑 .hg/hgrc?
最佳答案
对此没有命令,也不会有命令。有一次有人建议这是 Mercurial 的主要作者,Matt,tweeted:
What is it with coders who are intimidated by text-based config files? Like doctors that can't stand blood.
您可以制作
hg erc
命令通过将其放入您的个人 .hgrc
来打开该编辑器:[alias]
erc = !$EDITOR `$HG root`/.hg/hgrc
(最后来自史蒂夫·洛什)如果你想变得花哨,你可以做一个
post-clone
修改 .hg\hgrc
的钩子(Hook)使用 sed 或类似的文件,但您不会很快在 Mercurial 中找到该功能。
关于mercurial - 是否有在 mercurial 中设置默认路径的命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4994765/