git 在同一个电脑上配置两个远程仓库

来源:互联网 发布:cool edit mac 破解版 编辑:程序博客网 时间:2024/05/18 19:21

git 在同一个电脑上配置两个远程仓库
1.配置过程参考:
http://www.jianshu.com/p/04e9a885c5c8
2.配置过程中的问题
1.公司的git仓库在按照教程进行配置之后,总是提示 Permission denied (publickey)
搜索了相关问题,并没有得到解答。https://help.github.com/categories/authenticating-to-github/
github上的仓库地址访问是没有问题的
config文件:
Host 192.168.0.78
HostName 192.168.0.78
IdentityFile ~/.ssh/id_rsa
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa_hope
删除了本地的gitlab配置之后,远程仓库又是可以提交的,估计就是本地gitlab配置的问题了。
然后,我换了下位置
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa_hope
Host 192.168.0.78
HostName 192.168.0.78
IdentityFile ~/.ssh/id_rsa
就没有问题了。 ssh -T 命令访问成功

原创粉丝点击