0

I have access to a bitbucket repository (not hosted by Atlassian, but inside our company). I can browse the web GUI manually just fine.

But when I do a git clone, then it redirects to the BitBucket login page and thus git gives up.

$ git clone https://xyz.abc.def/bitbucket/mystuff
Cloning into 'mystuff'...
fatal: unable to update url base from redirection:
  asked for: https://xyz.abc.def/bitbucket/mystuff/repos/mystuff/info/refs?service=git-upload-pack
  redirect: https://xyz.abc.def/bitbucket/login?next=/mystuff/repos/mystuff/info/refs?service=git-upload-pack

I am used to git prompting for a username/password, but for some reason it does not do that here. But then, I am normally using Gitlab or other repository software and am not familiar with BitBucket.

What is the way to make git clone and BitBucket work together?

I am using git 2.15.1 (Linux) and the BitBucket server is version 5.1.0.

Note that I can not use an Access Key (ssh key pair) for non-technical, organizational reasons outside of the scope of this question.

EDIT: adding the username inbetween (https://myself@xyz.abc.def/...) does not change the behaviour at all.

AnoE
  • 8,048
  • 1
  • 21
  • 36
  • 1
    Possible duplicate of [How to provide username and password when run "git clone git@remote.git"?](https://stackoverflow.com/questions/10054318/how-to-provide-username-and-password-when-run-git-clone-gitremote-git) – phd Feb 22 '18 at 14:36
  • Well, close, @phd, but not the same. They are asking about the "ssh" access method; I am asking for https:// and also a bit specifically about BitBucket (the usual way https://user@... seems to be ignored by BitBucker...). – AnoE Feb 22 '18 at 18:13
  • The accepted answer there shows how to do that for https URLs. Clearly dup. – phd Feb 22 '18 at 20:00

1 Answers1

0

Use username in url

git clone http://<username>@<Bitbucket Server URL>/scm/<project key>/website.git

bitbucketserver/clone-your-repository-and-manage-files-locally

clone-a-repository

Jophy job
  • 1,924
  • 2
  • 20
  • 38