在 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/