It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Force username prompt in git clone

I want to setup a repo that has a remote without the username and would prompt for creditials when doing a pull/push. Is this possible with BitBucket. Something like

git clone

Curt Gratz

4 answers

1 accepted

1 vote
Answer accepted
Jeff Thomas Atlassian Team Oct 26, 2013

I think you need to update your version of Git.

I just tried to clone a repository from Bitbucket on one of my Linux boxes with Git 1.7.1 and received the same error that you did. I then tried to clone the same repository on another Linux box with Git and was prompted for my username.

Jeff Thomas Atlassian Team Oct 28, 2013

No problem, glad you got it working!

Like Chum likes this

Yep, an updated git version fixed it. Thanks a ton for the help!!!

0 votes
Jeff Thomas Atlassian Team Oct 25, 2013

Curt: I ran the clone command you list and was prompted for my username and password. That also sets up the remote fetch and push URLs so that they prompt for credentials as well.

Are you getting an error or not seeing this behavior?

Yes, I get a 401 unathorized. If i put a username in the url like

git clone

Then it prompts for a password, but of course no username.


Jeff Thomas Atlassian Team Oct 25, 2013

Which version of Git are you using (git --version)?

What operating system?

centos 6.4 and git 1.7.1

Jeff Thomas Atlassian Team Oct 25, 2013

Could you paste the output of the git clone command?

I'm not sure why it's giving you the HTTP 401 error, unless you already have some credentials setup. Do you happen to have a ~/.netrc file setup for bitbucket?

What's weird is I just tried from my mac with git and it works and prompts for the username/password

Initialized empty Git repository in /opt/sites/reponame/.git/

error: The requested URL returned error: 401 Unauthorized while accessing

fatal: HTTP request failed

I don't think i have a ~/.netrc file

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Bitbucket Server 7.0 is here!

Hello Community, I’m Anton Genkin, a product manager on the Bitbucket Server and Data Center team and am excited to share that Bitbucket Server 7.0 is now available! It's a platform release, one th...

1,066 views 6 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you