我正在嘗試克隆 GitHub 私有存盤庫。我可以訪問它
所以我做的是(HTTPS)
git clone https://github.com/xxxx1/xxxx2.git
當我這樣做時,我收到:
Cloning into 'xxxx2'...
remote: Repository not found.
fatal: repository 'https://github.com/xxxx1/xxxx2.git/' not found
對我來說最奇怪的第一件事是末尾的額外“/”,但我認為這不是問題所在。
我可以做 git clone 的唯一方法是通過 GitHub 桌面應用程式,通過 URL。
關于git 狀態
$ git status
On branch develop
Your branch is up to date with 'origin/develop'.
在git fetch 上
$ git fetch
remote: Repository not found.
fatal: repository 'https://github.com/xxxx1/xxxx2.git/' not found
所以問題是,我做錯了什么,無法通過 git bash 克隆 repo 槽?
非常感謝
uj5u.com熱心網友回復:
如果您對 Github 帳戶使用雙因素授權 (2FA),則只需使用 SSH 選項來克隆您的存盤庫:

uj5u.com熱心網友回復:
使用 Git bash 創建 SSH:這對我有用
ssh-keygen -t rsa -b 4096 -C "[email protected]"
輸入保存密鑰的檔案 (/c/Users/xxxx/.ssh/id_rsa):
按回車
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
按回車
$ cd .ssh
$ ls
已收到
id_rsa id_rsa.pub known_hosts
第一個是我們的私鑰(不要分享給任何人)
第二個是我們的公鑰
$貓id_rsa.pub
ssh-rsa […]
在 GitHub 上轉到您的用戶圖片:
- 設定
- SSH 和 GPG 密鑰
- 新的 SSH 密鑰:
- 標題:[空]
- 價值:我們的公鑰
- 單擊:添加新的 SSH 密鑰
在 Git bash 上:
- 光碟..
- 光碟檔案
- git 克隆 [email protected]:xxxx1/xxxx2.git
- cd [name_of_repo_cloned_folder]
- git checkout 開發
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/351144.html
