Issue #6583 open

Private wiki clone URL is missing username (BB-7769)

jean
created an issue

The default wiki content has e.g.:

Go ahead and try:

$ git clone https://bitbucket.org/jean/pools.git/wiki

This fails:

jean@klippie:~/repos/git$ git clone https://bitbucket.org/jean/pools.git/wiki pools-wiki
Initialized empty Git repository in /home/jean/repos/git/pools-wiki/.git/
error: The requested URL returned error: 401 while accessing https://bitbucket.org/jean/pools.git/wiki/info/refs

This works:

jean@klippie:~/repos/git$ git clone ssh://git@bitbucket.org/jean/pools.git/wiki pools-wiki
[...]
Receiving objects: 100% (3/3), done.

Comments (9)

  1. Erik van Zijst staff

    A 401 status code means you did not provide any credentials. Try the https clone again, but this time add your username to the URL:

    $ git clone https://jean@bitbucket.org/jean/pools.git/wiki
    

    The reason your SSH clone has no problems is because your public SSH key on your bitbucket account is used to authenticate you.

  2. jean reporter

    Cool, then I revise my suggestion to include the username in the default content link. Thanks for the response!

  3. Benjamin DeLong

    I have this same error but on a team repo. I intentionally leave the username out (see this question, coincidentally answered by you: http://stackoverflow.com/questions/15166722/use-own-username-password-with-git-and-bitbucket#answer-16203737), and this works for some of our team repos. But one of our repos gives this error:

    error: The requested URL returned error: 401 while accessing https://bitbucket.org/ursudio/call-to-view.git/info/refs
    

    I can access it when I put in my username, but then my coworkers can't access it. They would have to do another git remote rm origin and git remote add origin with their username in the URL. In our other repos, leaving the username out means that bitbucket will prompt us upon pulling or pushing for our username. Please help! Thanks.

  4. Log in to comment