簡體   English   中英

Git 顯示錯誤“第 2 行中的錯誤配置文件”

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM