是否有可能从github克隆没有完整的URL的git存储库?从github克隆git存储库没有完整的URL
例如:
当我要运行这个命令:git clone https://github.com/foo/bar.git
我想输入:git clone foo/bar
我在网上看到一个解决方案,但我无法找到它了。
是否有可能从github克隆没有完整的URL的git存储库?从github克隆git存储库没有完整的URL
例如:
当我要运行这个命令:git clone https://github.com/foo/bar.git
我想输入:git clone foo/bar
我在网上看到一个解决方案,但我无法找到它了。
您需要安装hub
工具,然后使git
为hub
的shell别名。
如果你只是想做到这一点使用git
你可以编辑你.gitconfig
文件中加入一个网址别名,像这样:
[url "<actual url base>"]
insteadOf = <other url base>
比如这个:
[url "https://github.com/"]
insteadOf = gh:
那么你可以做:
git clone gh:foo/bar.git
它不exacally你所要求的但是不得不安装另一个命令行工具。
谢谢,这就是我一直在寻找! – mamiu 2014-08-28 09:43:12