Bitbucket clone: Port number ended with 'T'
Asked Answered
J

4

5

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'
Jillene answered 2/11, 2017 at 13:31 Comment(3)
Have a look here. You're mixing SSH urls with https.Textuary
@AndrejsCainikovs I saw that issue too but I don't see what I'm mixing up. I checked here too confluence.atlassian.com/bitbucket/…Jillene
Are you routing through a proxy?Janessajanet
C
5

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 :-)

Canal answered 20/3, 2018 at 20:53 Comment(1)
I have found @ and # in passwords to be causing this problem so farCentner
M
4

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

Mismate answered 20/12, 2018 at 14:48 Comment(0)
A
0

For me also git clone was not working. But after adding proper git remote origin it worked.

Step 1. mkdir /local/repo/dir && cd /local/repo/dir
Step 2. git init
Step 3. git remote add origin https://<username>@bitbucket.org/<orgName>/<reponame>.git

Now git pull works without any issue

Antebellum answered 5/4, 2020 at 3:59 Comment(0)
L
0

Adding personal token resolved problem. Go to your account - personal access tokens, create token and use it instead of password.

git clone https://username:[email protected]/.../repo.git
Littrell answered 19/9, 2022 at 17:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.