Bitbucket clone: Port number ended with 'T'

十年热恋 提交于 2019-12-07 21:41:58

问题


I try to make a clone (mirror) of my bitbucket repo using jenkins execute shell (not the git plugin).

My credentials:

username
passwd

are saved in a variable: myuser The credentials are right. We used this plugin to save the credentials. We're doing exactly the same for some other repo's (on our local git, not bitbucket) and it's working very good.

Now I try:

git clone --mirror https://${myuser}@bitbucket.org/team/repo.git

The error I'm facing is:

fatal: unable to access 'https://****@bitbucket.org/team/repo.git/': Port number ended with 'T'

回答1:


We need to encode the URL while passing special characters in the usernames or passwords with http or https protocol. For example if you want to use user#1 in password and want to use it in URL you need to encode the # using %23 and the password becomes user%231.

Reference: https://github.com/curl/curl/issues/1909#issuecomment-331565533




回答2:


Was just banging by head around with a similar problem (attempt to clone from Gerrit over HTTPS with random HTTP password generated by Gerrit UI, URL in the form of https://<username>:<password>@<gerrit.repo.url> and getting 'Port Number ended with...' error), and it appears that the password must be properly url-quoted.

Realized that after trying to set git-credentials with 'store' helper and peeking at the file it created :-)



来源:https://stackoverflow.com/questions/47076616/bitbucket-clone-port-number-ended-with-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!