申明
借鉴文章出处:https://blog.csdn.net/Anerror/article/details/80550318
问题是什么?
今天遇见了一个问题,就是我git add .
之后,准备git commit -m "delete OS/Java file"
的时候他报了一个错,大概意思如下:
tell me what you are, you can use git config --global user.name yourname,and git config --global user.email youremail
可是在我使用这两句命令的时候,它又报了一个错,
error:could not lock config file .../.gitconfig:No such file or directory
意思就是它没有找到一个叫.gitconfig
的文件,虽然你电脑上有这个文件。
如何解决?
将.gitconfig
添加到HOME环境变量。
操作
1、我的.gitconfig
在 C:\Users\lenovo
下(lenovo是我电脑的用户名,我的电脑是有.gitconfig
文件的,如果没有手动新建一个)
2、新建系统变量,将.gitconfig
路径添加进去