colab连接github
- 在colab上生成你的ssh-key
!ssh-keygen -t rsa -b 4096 -C "email@example.com"
- 查看生成的ssh-key,并将它复制到你的github的ssh key中,添加ssh-key的过程可参考 链接
!cat /root/.ssh/id_rsa.pub
- 设置git的用户名和密码
!git config --global user.name "your name"
!git config --global user.email "email@example.com"
- 扫描并增加hosts文件
!ssh-keyscan github.com >> "/root/.ssh/known_hosts"
- 测试连接
!ssh -T git@github.com
- 克隆你需要的项目
!git clone git@github.com:xxx/xxxxx.git