删除 /home/.dotnet 后找不到 Git(凭据管理器)

删除 /home/.dotnet 后找不到 Git(凭据管理器)

最近我卸载了 .NET(它被错误地安装到了 /home/.dotnet/,dotnet 安装脚本),方法是从我的 Ubuntu 22.04 机器中删除该/home/.dotnet/文件夹。我有一个 repo,我正尝试将git push我的更改传输到远程,在我卸载 .NET 之前,它已经过身份验证并且运行良好(无需任何用户名或密码)。但是,现在运行此命令会显示以下消息:

$ git push
/home/yee/.dotnet/tools/git-credential-manager get: 1: /home/yee/.dotnet/tools/git-credential-manager: not found
Username for 'https://github.com': 
$ which git
/usr/bin/git

当我删除 .NET 所在的文件夹时,似乎它留下了一些残留。检查后$PATH,我得到了 /home/yee/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/yee/.dotnet/tools:/home/yee/.cabal/bin:/home/yee/.ghcup/bin

我运行了从 PATH 中export PATH=/home/yee/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/yee/.cabal/bin:/home/yee/.ghcup/bin删除,但命令仍然给出相同的结果。我还在 中搜索了,并在中删除了,然后重新启动了计算机,但仍然出现相同的问题。.dotnetgit push/etc/profile~/.bashrc.dotnetdotnet.sh/etc/profile.d

我该如何修复我的git安装?

答案1

.NET 已更改我的 Git 配置,以使用其自身作为凭证管理器,但当我删除它时,它就坏了。

为了修复,我按照以下方式运行了前两个命令这个问题

$ git config --global 'credential.https://github.com.helper' ''
$ git config --global --add 'credential.https://github.com.helper' '!gh auth git-credential'```

相关内容