【問題解決】Gitコマンドラインでよくあるエラーとその解決策

 

以下は、しばらく xshell を使用しなかった後に git コマンド ラインで発生した一連のエラーとその解決策です。

 このエラーが発生しました:

致命的: git リポジトリ (または親ディレクトリのいずれか) ではありません: .git

いくつかのブログや情報を参考にして解決方法を見つけました。

git init

 git Push を使用してファイルを送信すると、次のエラーが発生しました

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

 解決:

 git remote add origin 'http://git.....'
 git push -u origin master

このエラーが発生しました:

 解決:

git pull --rebase origin master

エラーが発生しました:

error: The following untracked working tree files would be overwritten by checkout

解決:

git clean -d -fx

エラーが発生しました:

** Please tell me who you are.

Run
  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'lvyp@NEU-20190128LYP.(none)')

 解決:

これは、ローカル ウェアハウスを作成したときにユーザー名とメールボックスを定義しなかったことを意味します。このとき、エラー プロンプトに従って次を使用します。

git config --global user.name "follow"
git config --global user.email "[email protected]"

もう一文

git config --local -l

 

おすすめ

転載: blog.csdn.net/m0_69061857/article/details/132222298