【问题标题】:Updated to Mac OSX El Capitan, and my gitconfig permissions seem to have changed更新到 Macos El Capitan,我的 git config 权限似乎已经改变
【发布时间】:2016-04-05 19:22:47
【问题描述】:

我刚刚将 Mac OSX 更新为 El Capitan,我的 .gitconfig 权限似乎已经改变。我正在尝试为我拥有的 fork 添加一个遥控器:

git remote add upstream <repo address>

这会导致以下错误。

error: could not lock config file .git/config: Permission denied

我该如何解决这个问题?

【问题讨论】:

    标签: git osx-elcapitan


    【解决方案1】:

    这可能有几个原因。

    这里有一些选项:

    • 验证是否存在名为~/.gitconfig.lock.git/config.lock 的文件 如果是这种情况,请删除它。

    • 重启,锁应该被释放

    • 如果这些都不能解决问题,您可以随时编辑 .git/config 并在其中设置上游。

    • 将原始文件重命名为其他文件,然后让 git 创建一个新文件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-16
      • 2016-03-11
      • 2020-03-09
      • 2015-12-28
      • 2016-01-16
      • 2015-05-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多