0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

git init の "unknown error occurred while reading the configuration files"への対処方法

Posted at

git init でまさかのエラー

git initでこんなエラーが出た。

(xxx) xxx$ git init
warning: unable to access '/Users/xxx/.gitconfig': Is a directory
warning: unable to access '/Users/xxx/.gitconfig': Is a directory
fatal: unknown error occurred while reading the configuration files

ちなみに環境は
macOS Big Sur 11.2.2
macbookPro16 M1じゃないやつ。

Anacondaでpython3.8の環境を作ってPythonアプリを作っていました。

対処方法

さて、エラーメッセージに従ってルートディレクトリを見ると、.gitconfigがある。

これを削除してみる。

(xxx) xxx$ rm .gitconfig
rm: .gitconfig: is a directory

どうやらディレクトリとして認識されている。

(xxx) xxx$ rm -r .gitconfig
rm: .gitconfig: is a directory

これで削除出来た。

対象のディレクトリに移動して、

(st0) xxx$ git init
Initialized empty Git repository in /Users/xxx/.git/

出来た!

個人的備忘録です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?