git - 无论是否使用 sudo,都无法在未以 root 身份登录的情况下克隆 github repo

标签 git macos unix

在 OSX 上运行 ->

git clone https://github.com/.../project.git
Cloning into 'project'...
remote: Repository not found.
fatal: repository 'https://github.com/.../project.git/' not found

...:repos ...$ sudo git clone https://github.com/.../project.git
Cloning into 'project'...
remote: Repository not found.
fatal: repository 'https://github.com/.../project.git/' not found


...:repos ...$ sudo su


sh-3.2# git clone https://github.com/.../project.git
Cloning into 'project'...
remote: Counting objects: 122, done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 122 (delta 28), reused 114 (delta 20), pack-reused 0
Receiving objects: 100% (122/122), 364.08 KiB | 0 bytes/s, done.
Resolving deltas: 100% (28/28), done.

另一件奇怪的事情是,这是一个私有(private)仓库,当我是 root 时,它不会询问我的密码。我假设它存储在某个地方。

编辑:解决方案是删除 osx 钥匙串(keychain)中现有的钥匙串(keychain)元素

最佳答案

您必须删除 osxkeychain 中的 github 凭据,然后才能重新创建它们。

关于git - 无论是否使用 sudo,都无法在未以 root 身份登录的情况下克隆 github repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45716375/

相关文章:

Git - 如何在功能分支中拆分代码,以便将来从 master 进行 merge/ rebase 时不会从功能分支中删除代码

macos - 在 macOS 上使用/tmp 可以吗?

objective-c - 即使应用程序空闲,NSOutlineView 也会不断更新

linux - 在 Unix 中搜索和打印

java - 在一个命令中提取多个 jar

Git:两​​个项目,每个项目都在一个仓库中。将子目录中的新 repo 与单一线性历史相结合

git - 更新 git 时出现 Homebrew 错误

java - Apache Tomcat 7 显示空白页面 Mac OSX 10.8

linux - Unix 脚本文件重定向

Git 推送错误 : RPC failed: curl 52