git clone:“遠端:找不到您要找的名稱空間。” ……“致命:無法從遠端存儲庫讀取。”

git clone:“遠端:找不到您要找的名稱空間。” ……“致命:無法從遠端存儲庫讀取。”

嘗試從 GitLab 複製我的測試儲存庫時,我收到以下錯誤。

C:\Users\USERNAME\Documents\MYPROJECT\test>git clone [email protected]:GITUSERNAME\test.git
Cloning into 'test'...
remote:
remote: ========================================================================
remote:
remote: The namespace you were looking for could not be found.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

答案1

只是想與其他人分享這個愚蠢的錯誤,將 Windows 路徑分隔符號「\」與 URL 分隔符號「/」混淆:

代替

git clone [email protected]:GITUSERNAME\test.git

你需要

git clone [email protected]:GITUSERNAME/test.git

和 ”/”。

這看起來似乎很明顯,但我花了一些時間才意識到這一點。

後期補充:

我又遇到了同樣的錯誤,但由於另一件事,它仍然只是一個錯誤的 URL。我試過

git clone ssh://[email protected]:GITUSERNAME/test.git

雖然我需要:

git clone [email protected]:GITUSERNAME/test.git

相關內容