git clone github的公开仓库:ssh方式
第一轮
目标
使用SSH/https方式clone一个,在github上已存在的仓库
资源
git clone through ssh - Stack Overflow
Cloning a repository - User Documentation
Testing your SSH connection - User Documentation
命令行
git clone ssh://git@github.com:DebugUself/planet.git
-> 不成功git clone https://github.com/DebugUself/planet.git
-> 成功
第二轮
目标
回顾资料后,寻找ssh方式到底哪里出现问题?
资源
命令行
use relative link git clone git@github.com:DebugUself/planet.git
-> 成功
use absolute link git clone ssh://git@github.com/~/DebugUself/planet.git
-> 不成功
总结
- 通过ssh方式clone github上公开仓库是可行,具体有两种方法。这两种方法的区分为:使用relative link,还是使用absolute link。使用方法不同,命令行也不一样。relative link的命令行大致为
git clone git@github.com:relative/path/repo.git
,absolute link的命令行大致为git clone ssh://git@github.com/absolute/path/repo.git
。但由于github建议使用relative link来clone repo,所以尽量使用relative link的方法比较合适。(见Basic writing and formatting syntax - User Documentation) - 老师傅指出 不懂得看git log提示才是大麻烦。如何看git log提示,检查一遍git log里重复的字段,可能会发现线索。(见上图:git-clone-ssh方式2)
Changelog
2018年07月11日09:36:46 第二轮
2018年07月10日10:07:54 第一轮