Git配置error:could not lock config file .../.gitconfig:No such file or directory

今天设置git用户和密码时突然报错error:could not lock config file .../.gitconfig:No such file or directory

检查了C:/Users/LC目录下是有.gitconfig配置文件的,在网上搜查的方法都不适用,花了很常时间才发现原来是多了一个空格,

环境变量之前用的是%USERPROFILE%改成C:/Users/LC就好了,

再次配置

$ git config --global user.name "***"
$ git config --global user.email "***"

就好了!



猜你喜欢

转载自blog.csdn.net/Anerror/article/details/80550318