"Git错误:无法锁定配置文件C:/Users/old_profile/.gitconfig:没有这样的文件或目录"配置文件迁移后 [英] "Git error: could not lock config file C:/Users/old_profile/.gitconfig: No such file or directory" after profile migration

查看:682
本文介绍了"Git错误:无法锁定配置文件C:/Users/old_profile/.gitconfig:没有这样的文件或目录"配置文件迁移后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有趣的错误,在Windows上使用git时会不断出现(版本2.12.0.windows.1).我最近将Windows配置文件目录从一个位置迁移到另一个位置.

I have an interesting error that keeps coming up when using git for windows (version 2.12.0.windows.1). I recently migrated my windows profile directory from one location to another.

对于某些git命令,我会收到错误消息:

For some git commands I get the error:

error: could not lock config file C:/Users/<my old profile>/.influxdb/.gitconfig: No such file or directory error: could not lock config file C:/Users/<my old profile>/.influxdb/.gitconfig: No such file or directory

error: could not lock config file C:/Users/<my old profile>/.influxdb/.gitconfig: No such file or directory error: could not lock config file C:/Users/<my old profile>/.influxdb/.gitconfig: No such file or directory

注意:此错误总是出现两次,例如,如果我尝试执行git config --global diff.tool p4merge

Note: This error always comes up twice, for example if I try to do git config --global diff.tool p4merge

有趣的是,它要查找的文件夹不存在,如果我使用git config -l --show-origin来查看git从何处获取它的设置,则不会提及此路径,并且如果我查看任何文件,看不到对此不存在的路径的引用.

What is interesting is that this folder it's looking for doesn't exist, and if i use git config -l --show-origin to see where git is getting it's settings, it makes no mention of this path, and if I look inside any CONFIG files I can see no reference to this non-existant path.

git在哪里存储对此旧路径的引用?我需要更新它,因为我认为此错误正在停止某些命令的工作.

Where is git storing a reference to this old path? I need to update it as I think this error is stopping some commands working.

推荐答案

我遇到了类似的问题.

I faced similar issue.

错误:无法锁定配置文件C:/.gitconfig:

Error: could not lock config file C:/.gitconfig:

解决方案::我的计算机中有系统环境变量(Home= C:\),它引起了此问题.删除它,一切开始工作.

Solution: I had a system environment variable (Home= C:\ ) in my computer and it caused this issue. Deleted it and everything started working.

这篇关于"Git错误:无法锁定配置文件C:/Users/old_profile/.gitconfig:没有这样的文件或目录"配置文件迁移后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆