0
我們的組織中有一個新的GitLab服務器。我打開了一個新項目並按照他們的幫助頁面創建了一個SSH對。但是我無法推送初始提交。 GitLab告訴我這樣做:爲什麼我無法推送到GitLab存儲庫?
cd existing_folder
git init
git remote add origin
[email protected]:Groupname/Projectname.git
git add .
git commit -m "Initial commit"
git push -u origin master
所有這些步驟都起作用,除了最後一步之外。當我試圖把它說:
ssh: Could not resolve hostname myorganization: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我用git remote -v
,我注意到它的輸出具有Myorganization
以大寫字母(在中間的某個地方,「myorganization」只是一個佔位符)。然後我嘗試了git remote set-url origin
並輸入了從git remote -v
的輸出。但試圖推動仍然導致上述錯誤。在錯誤消息中,myorganization
保持小寫。我不知道區分大小寫是否可以在這裏發揮作用,這只是我注意到的。
這似乎是一個比GitLab更多的DNS問題。 '''host myorganization'''命令是否可以解析機器的IP? – alexp
你必須使用代理嗎?如果是這樣的話:你是否設置了git的代理? – Pixelchemist
是的,'host myorganization'以及'host Myorganization'解析服務器IP。 – speedymcs