git config :.../.gitconfig:No such file or directory

.../.gitconfig:No such file or directory

申明

借鉴文章出处: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、我的.gitconfigC:\Users\lenovo 下(lenovo是我电脑的用户名,我的电脑是有.gitconfig 文件的,如果没有手动新建一个)
2、新建系统变量,将.gitconfig路径添加进去
在这里插入图片描述

测试

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值