git - 卸载和安装 Homebrew 时出现 Git 错误
问题描述
因此,出于某种原因,我使用 Ruby 命令从计算机上卸载了 Homebrew,该命令显示“这将卸载所有使用 Brew 安装的软件包”。我这样做了,现在当我再次尝试安装 Homebrew 时,我收到一个 Git 错误,提示“请确保您具有正确的访问权限”。
我认为这个错误是因为卸载 Brew 卸载了 Git,但是当我输入“git --version”时,我得到“git version 2.15.0”,所以这不是问题。
然后我生成了一个新的 SSH 密钥,并将公钥添加到我的 git 帐户中。正在做
ssh -T git@github.com
给我
Hi {{username}}! You've successfully authenticated, but GitHub does not provide shell access
即使我尝试 git clone 我自己的 repo,我也会得到同样的错误:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
这是 Brew 安装的日志
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Homebrew
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Homebrew
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown rafaykalim /usr/local/Homebrew
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force
我还手动删除了 /usr/local/Homebrew。这是卸载 Brew 的命令:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
编辑:我刚从我的电脑上卸载了 git,我仍然遇到同样的错误。不知道发生了什么!
我使用此脚本卸载 Git: https ://gist.github.com/naomik/11245234
解决方案
推荐阅读
- python - 如何确保 TFLite Interpreter 仅使用 int8 操作?
- graphql - 用户未定义 Express-GraphQl 错误
- python - 从函数中获取变量的问题
- python - python variable float format #ValueError: 格式说明符缺少精度
- blazor - Blazor On Parent 单击然后检查子复选框
- python - 查找和替换不变的列表
- python - 如何使用 serializers.py 中的密码字段 ..password2=serializers.Charfield(serializers.widget=PasswordInput()) 在使用时不起作用
- c# - 内存消耗什么?
- python - 如何在包 __init__.py 文件中处理导入?
- azure-active-directory - Azure AD B2C 声明转换