linux - git config --global user.email johndoe@example.com 锁定文件错误

标签 linux git

abdullah@XPS:~/Documents/repos/first_app$ git config --global user.email johndoe@example.com
error: could not lock config file /home/abdullah/.gitconfig: No such file or directory

我试过 mkdir .gitconfig,它说它已经存在了。 当我尝试访问任何 .file 时,它​​说没有这样的文件,即使它就在那里。

picture of terminal

最佳答案

您的全局 .gitconfig 文件是您下载文件夹中 .gitconfig 的符号链接(symbolic link)。也许该文件不再可用?

无论如何,我建议删除符号链接(symbolic link)并创建一个新的 .gitconfig 文件:

rm ~/.gitconfig
touch ~/.gitconfig

然后您应该能够运行您的命令:

git config --global user.email johndoe@example.com

关于linux - git config --global user.email johndoe@example.com 锁定文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51353019/

相关文章:

linux - 有人可以帮助我了解这个 shell 脚本背后的方法吗?

git - 如何从 USB 内存棒运行 Git 1.6.x for Windows

git - 如何使用 Git 防止自动 merge ?

linux - 有限制的 Shellcode

php - Centos 6.4安装php54-xml时出错

linux - Linux 中 shell 脚本的更改不会刷新

linux - 在使用 java 1.6 的 Redhat 中找到应用程序/路径

Git 克隆存储库错误 : RPC failed; result=56, HTTP 代码 = 200

git - 由于 Adob​​e Brackets 中的 Git 而丢失所有文件

git - 使用ssh克隆Git仓库