首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法从终端访问git

无法从终端访问git
EN

Stack Overflow用户
提问于 2021-09-04 11:10:30
回答 1查看 65关注 0票数 0
代码语言:javascript
运行
复制
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,但由于某些未知原因,它也无法工作

代码语言:javascript
运行
复制
 ~  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 brew版本: Homebrew 3.2.9 git版本: git版本2.33.0

提前感谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-04 11:52:48

要修复Permission denied,可以运行以下命令:

代码语言:javascript
运行
复制
sudo chown -R ${LOGNAME}:staff /usr/local/*

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69054728

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档