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之间加了空格,去掉即可


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM