2015-06-22 36 views
0

我正在一個團隊中工作,我們使用bitbucket作爲我們的代碼。我們還有一臺用於測試我們的應用的實時服務器。團隊中的每個人都可以通過SSH訪問此服務器。要在服務器上發佈最新代碼,團隊成員應通過SSH登錄並執行git pull命令。Git詢問密碼,但不是用戶名

但是,當我打開我的bitbucket repo時,它顯示了這種格式的克隆URL https://[email protected]/MY-TEAM-NAME/REPO-NAME 我用它來克隆回購。現在,當我使用git clone時,git使用MY-USERNAME並僅要求密碼。但我希望它也要求輸入用戶名,因爲該團隊的其他成員可能會使用此服務器並執行git pull

看起來我使用的是錯誤的URL,因爲它已經獲得了我的用戶名。我在哪裏得到一個沒有用戶名的通用的?

回答

2

只需從URL的開頭刪除[email protected],然後Git就會詢問兩者。 HTTP允許您在URL的開頭使用user:[email protected]進行身份驗證,BitBucket會通過向您提供個人URL以幫助您保存輸入,從而爲您提供幫助。

$ git clone https://[email protected]/newuserme/bb101repo.git 
Cloning into 'bb101repo'... 
Password for 'https://[email protected]': 

$ git clone https://bitbucket.org/newuserme/bb101repo.git 
Cloning into 'bb101repo'... 
Username for 'https://bitbucket.org': someoneelse 
Password for 'https://[email protected]': 
:使用到位桶的示例應用程序的概念

證明

相關問題