3

I came across a weird issue. A new co-worker has joined my team. He tried to clone the repo and git has asked him for my password. We have verified that it doesn't accept his bitbucket password, while it accepts mine.

Some additional facts:

  • He already uses git in another project, with credentials stored in netrc, and it works fine. Both repositories are on bitbucket so credentials should be the same.
  • Other co-workers had no problem with cloning into this repo.
  • He has a write access, just like the rest of the team.

If he had the same problem in a second repo, or another person had it, this would give me a clue. But that's not the case, and I'm confused.

Our remote repositories are hosted at bitbucket. He's using Windows.

What else could I be missing?

tsuma534
  • 198
  • 11
  • Is the url of the BitBucket repo (which fails to be cloned) is an ssh one, or an https one? – VonC May 06 '14 at 13:23
  • It's https. I think I may have found a solution: http://stackoverflow.com/questions/15166722/use-own-username-password-with-git-and-bitbucket I'll try it when that teammate is online. – tsuma534 May 06 '14 at 13:29
  • Do you mean yuor login was embedded within the https url he was using? – VonC May 06 '14 at 13:32
  • Yes, I have send it to him via email, while I was explaning him the tasks. Up to today I haven't known it's relevant. – tsuma534 May 06 '14 at 13:58
  • Ok. I have added an answer which illustrates what could have happened here. – VonC May 06 '14 at 14:03

1 Answers1

4

If it is asking for your password, it means it tries to authenticate with your login.

That means, if the repo was cloned (using your password), a git remote -v must show an url like:

https://YourLogin@server/path/to/repo

You can instruct the user to change the remote url named 'origin' with:

git remote set-url origin https://HisLogin@server/path/to/repo
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes, that was the case. I thought that MyUsername part is there simply because it's my repo. That was silly of me. And thus I have sent my clone URL to a co-worker. – tsuma534 May 06 '14 at 18:05