[英]How can I escape `@` of password in git URL
借口:
我看到了這一點: git代理密碼中的Escape @字符但這是關於http.proxy
參數的,而p%4055
在url
參數方面對我不起作用。
我的問題:
我使用git版本1.7.1
我的密碼存儲庫是: p@55
我使用gitlab
服務器,並使用centos
作為客戶端。
在.git/config
文件中,我是這樣的:
[remote "origin"]
url = http://user:p@55@domain.com:port/repo.git
但是當我拉它時,給了我這個錯誤:
error: Couldn't resolve host '55:domain.com' while accessing ...
我知道轉義@
char,但是:
我嘗試p\\@55
,給我這個錯誤:
fatal: bad config file line 8 in .git/config
我嘗試p%4055
,給我這個錯誤:
error: The requested URL returned error: 401 while accessing ...
我只是將git版本從1.7.1升級到2.11.1,這對我有用:
url = http://user:p%4055@domain.com:port/repo.git
嘗試使用@-(%40)符號的URL編碼值。
您的例子:
網址= http:// user:p%4055@domain.com:port / repo.git
編輯:
如果上述方法不起作用,請使用以下方法:
sshpass -p密碼git克隆ssh://username@onboard.com/srv/git/repo
您可以使用git憑據助手:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.