git解决 fatal: not in a git directory

git解决 fatal: not in a git directory
 
问题描述:
执行下面语句时报错:fatal: not in a git directory

git config --global user.name "yourName" //注意,--和global之间没有空格
git config --global user.email "yourName@gmail.com"
 

先进入git目录,或使用 git init 新建一个 Git 仓库。
然后再执行即可。

如果报错:
error :key does not contain a section: global

出现错误的原因是–和global之间加了空格,去掉即可

原文地址:https://www.cnblogs.com/emanlee/p/12993683.html