2017-06-04 117 views
0

我剛剛完成安裝gitlab,並注意到當我創建一個新的回購時,回購網站的url包括我的用戶名之前的gitlab網址。如何排除用戶名從gitlab url

git clone http://[email protected]/jonesdem/firstrepo.git 
cd firstrepo 
touch README.md 
git add README.md 
git commit -m "add README" 
git push -u origin master 

我想的URL看起來像這樣

git clone http://gitlab.example.com/jonesdem/firstrepo.git 
cd firstrepo 
touch README.md 
git add README.md 
git commit -m "add README" 
git push -u origin master 

任何想法來調整,以解決這個問題,其配置設置,我需要?

回答

0

這不是GitLab一個可配置的選項,因爲它是普遍接受的做法格式使用的URL GitLab是爲他們提供


但是,下面應該努力盡我所知:

在你的git倉庫的目錄:

git clone http://gitlab.example.com/jonesdem/firstrepo.git 

然後,當你需要按:

git config credential.helper store 
git push http://gitlab.example.com/jonesdem/firstrepo.git 

Username for 'https://gitlab.example.com.com': <USERNAME> 
Password for 'https://[email protected]': <PASSWORD> 

username上的HTTP(S)URL的@用於指示用戶的,你不能推,如果你還沒有通過身份驗證的遠程git倉庫進行身份驗證之前 - 這就是爲什麼它是存在。通常的做法是使用URL,例如http://[email protected]/jonesdem/firstrepo.git,而不是使用我上面指出的方法。