/c/Windows/System32にいるときを除いて、git config
とgitコマンドを実行すると、エラーfatal: bad config file line 12 in .git/config
が発生します。私はgit bashを管理者として実行しようとしましたが、違いはありません。git configファイル - 致命的:設定ファイル12行が不正です。
私は/ C /ユーザーで私の.gitconfigファイルを見ると、//それは次のようになります。<name>, <internal proxy>, <file> and <email>
で
[core]
symlinks = false
autocrlf = true
[color]
diff = auto
status = auto
branch = auto
interactive = true
[pack]
packSizeLimit = 2g
[help]
format = html
[http]
sslCAinfo = /bin/<file>
[https]
proxy=<internal proxy>
[user]
name=<name>
email=<email>
[sendemail]
smtpserver = /bin/<file>
[diff "astextplain"]
textconv = astextplain
[rebase]
autosquash = true
は正しい内容に置き換えられます。また、ファイルはGITCONFIG
ファイルのファイルタイプを持ち、.gitconfig
と呼ばれます。の/ etc /マイgitconfigファイルがどのように見える
:再び
[core]
symlinks = false
autocrlf = true
[color]
diff = auto
status = auto
branch = auto
interactive = true
[pack]
packSizeLimit = 2g
[http]
sslCAinfo = /bin/<file>
[https]
proxy=<internal proxy>
[user]
name=<name>
email=<email>
[sendemail]
smtpserver = /bin/<file>
[diff "astextplain"]
textconv = astextplain
[rebase]
autosquash = true
、<name>, <internal proxy>, <file> and <email>
は正しい内容に置き換えられます。この場合、ファイルのファイルタイプはFile
で、gitconfig
となります。
誰でも問題を解決してgitコマンドを実行し続けることができますか?
エラーが '.git/config'という名前のファイルを指していることに注意してください。あなたがここに投稿したファイルはそのファイルではないようです。 –
エラーメッセージは、問題がリポジトリのローカル構成ファイルにあることを示します。これはgitがあなたがリポジトリの作業ツリーにいることを認識している場合にのみ可能になるはずです。これがいつ起きるかのレポートに基づいて 'C:'ルートディレクトリに '.git'ディレクトリがあるのでしょうか? –
いずれにせよ、このエラーが出たら、 'git rev-parse --git-dir'と言うことができます。これはディレクトリを指しています。そのディレクトリに 'cd'を実行すると、' config'という名前のファイルがあります。そのファイルにはエラーが含まれている必要があります(何が問題なのかがまだ分かっていない場合は、そのファイルの内容を投稿する必要があります) –