[英]Git shows error “bad config file in line 2”
我應該如何為兩個帳戶正確配置文件。 我的 github 的 gitconfig 文件
[github]
Host github.com
HostName github.com
IdentityFile ~/.ssh/github
User git
IdentitiesOnly yes
[gitlab]
Host gitlab.com
HostName gitlab.com
IdentityFile ~/.ssh/id_rsa
User git
IdentitiesOnly yes
看起來您已將此內容放入主目錄中的.gitconfig
文件中。 該配置文件適用於 Git 配置,但您指定的配置適用於 SSH。 您應該將此內容從~/.gitconfig
中取出並將其放入~/.ssh/config
中,當您推送到 Git 存儲庫時, ssh
可以使用它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.