我在尝试设置全局配置时遇到以下错误:
$ git config --global user.name "Your Name Here"
error: could not lock config file /pathto/file/.gitconfig: No such file or directory
而且文件.gitconfig已经存在了,谁有什么想法??
发布于 2013-02-19 15:03:37
有点像"Trouble setting up Tower with my GitHub Account - error: could not lock config file",检查一下这个~/.gitconfig
文件是如何创建的。
Ie:与它相关的权限是什么?
还要确保在执行git config --global
命令时正确设置了$HOME
变量。
发布于 2015-07-07 15:36:25
检查主文件夹中是否有.git目录,如果没有:
mkdir ~/.git
解决了我的问题。
发布于 2013-11-07 16:01:32
当gitconfig存在锁定文件时,我得到了这个错误。尝试找到并删除.gitconfig.lock (在我的linux机器上,它位于我的主目录中)
https://stackoverflow.com/questions/14959972
复制