github多个ssh密钥
github-ssh的Python项目详细描述
安装
$ [sudo] pip install github-ssh
功能
github多个ssh密钥
工作原理
- 创建ssh密钥文件、ssh配置文件、将公钥复制到剪贴板并打开github settings -> SSH keys
- 如果SSH密钥存在并且工作
~/.ssh/config
Host *
Include config.d/*
Include config.d/*/*
脚本使用
usage: github-ssh username
示例
$ github-ssh username
~/.ssh/config
Host *
Include config.d/*
Include config.d/*/*
usage: github-ssh username
示例
$ github-ssh username
创建的文件:
~/.ssh/github/id_rsa_github_username
~/.ssh/github/id_rsa_github_username.pub (add to github settings -> SSH keys)
~/.ssh/config.d/github/username.github.com
$ cd path/to/repo
$ git remote add github git@username.github.com:username/repo.git