【问题标题】:unable to access git from terminal无法从终端访问 git
【发布时间】:2021-11-02 08:58:41
【问题描述】:
git config --global user.name "chirrumishra"                                                       ✔ 
error: could not lock config file /Users/chiranjeevmishra/.gitconfig: No such file or directory

唯一可用的数据 git config --list credential.helper

尝试使用 brew 重新安装 git,但由于某些未知原因,它也无法正常工作

 ~  brew reinstall git                                                                        INT х │ 7s 
==> Downloading https://ghcr.io/v2/homebrew/core/git/manifests/2.33.0
Already downloaded: /Users/chiranjeevmishra/Library/Caches/Homebrew/downloads/b24ae98d6ab2b75abc62451721dc6191764b44543e218d5f937f6e85d4b11b17--git-2.33.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/git/blobs/sha256:1b89ec39f7a4b865b3c671f9b2495ec859925951
Already downloaded: /Users/chiranjeevmishra/Library/Caches/Homebrew/downloads/6a93895ce790e15c09265ac022b1830dc40f083404f5059ce8c0c99814c8074e--git--2.33.0.big_sur.bottle.tar.gz
==> Reinstalling git 
==> Pouring git--2.33.0.big_sur.bottle.tar.gz
==> Caveats
The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula.

zsh completions and functions have been installed to:
  /usr/local/share/zsh/site-functions

Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/git
==> Summary
????  /usr/local/Cellar/git/2.33.0: 1,508 files, 42MB
==> `brew cleanup` has not been run in 30 days, running now...
Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins


 ~  git config --global credential.helper store                                                1 х │ 38s 
error: could not lock config file /Users/chiranjeevmishra/.gitconfig: No such file or directory

使用的操作系统:Mac OS Big Sur 11.4 酿造版本:自制 3.2.9 git 版本:git 版本 2.33.0

提前致谢

【问题讨论】:

    标签: git macos github homebrew


    【解决方案1】:

    要修复Permission denied,您可以运行:

    sudo chown -R ${LOGNAME}:staff /usr/local/*
    

    希望.gitconfig 问题也将得到解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-20
      • 1970-01-01
      • 1970-01-01
      • 2018-06-25
      • 1970-01-01
      • 2015-02-16
      • 2019-12-21
      • 1970-01-01
      相关资源
      最近更新 更多