git ssh配置文件错误

时间:2016-10-31 06:38:51

标签: git ssh

我正在尝试在我的Mac中添加多个ssh文件,我将我的ssh配置文件保存为:

Host github
    HostName github.com
    User fizix100
    IdentityFile ~/.ssh/id_rsa_github

但它不起作用,当我尝试拉远程文件时显示错误:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin 
/Users/fengzhenxing/.ssh/config: line 3: Bad configuration option: user:fizix100
/Users/fengzhenxing/.ssh/config: terminating, 1 bad configuration options
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see above

1 个答案:

答案 0 :(得分:1)

从ssh config的User指令中删除冒号

Host github
    HostName github.com
    User fizix100
    IdentityFile ~/.ssh/id_rsa_github