小智 46
不。您只需使用不同的 URL:
git clone git://github.com/SomeUser/SomeRepo.git
Run Code Online (Sandbox Code Playgroud)
但是,本地存储库将是“只读”的,因为您将无法将更改推送回原始存储库。不过,您仍然可以在本地修改文件和提交更改。
相比之下,
git clone git@github.com:UserName/OtherRepo.git
Run Code Online (Sandbox Code Playgroud)
仅当您使用必要的 SSH 密钥等正确设置环境时才有效,但作为回报,您将获得一个存储库,允许您将更改提交/推送回远程存储库。
(抱歉无意中为 GitHub 做广告,我只是想到了。)
小智 5
我正在关注需要从 github 克隆的产品的一些文档。我不想费心设置一个帐户,所以我需要完全按照这里的要求去做。
文档中的命令是:
git clone git://github.com/fcrepo4/fcrepo-message-consumer.git
Run Code Online (Sandbox Code Playgroud)
但这对我来说失败了。
Cloning into 'fcrepo-message-consumer'...
ssh: Could not resolve hostname github.com: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
Run Code Online (Sandbox Code Playgroud)
我试过
git clone git://github.com/fcrepo4/fcrepo-message-consumer.git
Run Code Online (Sandbox Code Playgroud)
正如其中一个答案中所建议的那样,但也失败了。
Cloning into 'fcrepo-message-consumer'...
fatal: Unable to look up github.com (port 9418) (nodename nor servname provided, or not known)
Run Code Online (Sandbox Code Playgroud)
最终奏效的是:
git clone https://github.com/fcrepo4/fcrepo-message-consumer.git
Run Code Online (Sandbox Code Playgroud)
或者只使用 http 前缀,.git 后缀也不是必需的:
您可以检查
git clone http://github.com/tizenteam/iotivity-example
Run Code Online (Sandbox Code Playgroud)
相关信息:
https://help.github.com/articles/why-is-git-always-asking-for-my-password/
归档时间: |
|
查看次数: |
61425 次 |
最近记录: |