Bitbucket, Windows and "fatal: could not read Password for"
Asked Answered
P

15

78

I recently reinstalled Windows and I have a problem with downloading files from repository.

I have installed GIT and Python, but when I am trying to download anything from Bitbucket I get the message:

"fatal: could not read Password for: 'https://[email protected]': No such file or directory".

What am I doing wrong?

Perdomo answered 4/1, 2014 at 15:59 Comment(1)
this worked for me if you don't want to setup ssh https://mcmap.net/q/120961/-cannot-push-to-bitbucket-via-https-anymore-git-returns-fatal-errorPergrim
L
31

I had the same problem an hour or so ago. My issue was that I was trying to do a git clone but using the https url instead of the ssh one. If you go to your repository you can select ssh or https from the dropdown for the clone url. Hope that helps!

Langmuir answered 4/1, 2014 at 16:2 Comment(5)
Git bash has ssh in it although you don't need to use it directly. In git bash just do git clone <the ssh url for your repo>Langmuir
I found this document useful as you might have to create an ssh key to allow the authentication confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+GitLangmuir
I followed the instructions there and still the same fatal error.Perdomo
Make sure you are using the ssh url and not the https one imgur.com/y1dKKNuLangmuir
I'm sure that I'm using correct url. I modified git config, so it uses the ssh one.Perdomo
P
122

I solved it setting a global parameter:

git config --global core.askpass /usr/libexec/git-core/git-gui--askpass
Photofluorography answered 27/1, 2014 at 8:36 Comment(7)
This was very helpful on my PC, but I just installed git on my laptop (Win 8.1), and the command line asked me for the password with no need of your solution. Does anybody know why some installations don't need this solution?Ia
@Ia this appears to be a git version issue. That might explain the difference you seeDecameter
in my case git-core was just in usr/lib/Eudora
Thanks so much! If that command doesn't work, git-gui-askpass might be in a different location. I'm using cmder, so I ran this command: git config --global core.askpass "C:\Program Files\cmder\vendor\msysgit\libexe c\git-core\git-gui--askpass"England
if you have x64 windows and installed "git for windows" than this might helps git config --global core.askpass "C:\Program Files (x86)\Git\libexec\git-core\git-gui--askp ass"Surfing
I've got x64 git for windows and typed: git config --global core.askpass "C:\Program Files\Git\\mingw64\libexec\git-core\git-gui--askpass"Timothy
open-ssh askpass works as well git config --global core.askpass /usr/bin/ssh-askpassFibriform
G
70

Try to include your username and password in the URL like this:

git clone https://username:[email protected]/path_to/myRepo.git
Gwendolyn answered 6/1, 2014 at 22:44 Comment(5)
Instead of cloning again, you can also modify .git/config file to add your password into the url. However, it is not secure to leave your password in a plan config file though.Whiteside
@SimonXinCheng Creating a SSH key and adding it to BitBucket is a really better solution than writing your password in plain text into the config file.Siliqua
btw: not secure at allColquitt
Needed this for testing scripts on a container, throwaway use once scenarioSolar
modify the URL by menu: Git -> Manage Remotes -> edit the origin URLCanossa
L
31

I had the same problem an hour or so ago. My issue was that I was trying to do a git clone but using the https url instead of the ssh one. If you go to your repository you can select ssh or https from the dropdown for the clone url. Hope that helps!

Langmuir answered 4/1, 2014 at 16:2 Comment(5)
Git bash has ssh in it although you don't need to use it directly. In git bash just do git clone <the ssh url for your repo>Langmuir
I found this document useful as you might have to create an ssh key to allow the authentication confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+GitLangmuir
I followed the instructions there and still the same fatal error.Perdomo
Make sure you are using the ssh url and not the https one imgur.com/y1dKKNuLangmuir
I'm sure that I'm using correct url. I modified git config, so it uses the ssh one.Perdomo
R
12

Just solved this Problem

Git in Version 1.8.5.2 contains a but using bitbucket, updating my Git to Version 1.9.0 solved this problem.

Roslynrosmarin answered 7/4, 2014 at 11:22 Comment(2)
This also solved the issue for me. Upgraded from 1.8.5.2 to 1.9.4 (Windows 7 64bit)Operculum
Same for me. Windows7, 64bit, Upgraded from 1.8.5 to 1.9.4Strigil
E
9

I just tried to do the same thing and it did not work for me, and I too recently reinstalled windows on my machine.

I am used to checking out a private repo from my bitbucket account by using the simple command git clone https://[email protected]/username/repo.git and then being prompted to enter a password for my user.

It looks like this might be broken in version 1.8.5.2. I downgraded to version 1.8.4 and it started working as expected.

Git download list: http://code.google.com/p/msysgit/downloads/list

Hope this helps!

Emmuela answered 26/1, 2014 at 6:57 Comment(4)
+1 this described and fixed the issue for me too ... logging a bug on git siteBrodie
+1 Thank you! If anyone is looking for the previous version, get it here: code.google.com/p/msysgit/downloads/…Gamopetalous
I've created an unofficial fix release (1.8.5.4) for people who want to or need to use a Git version newer than 1.8.4. This should serve as an intermediate solution until a new official release is made.Corkage
Git for windows 1.9.0-preview20140217 is now out, and I confirmed that it fixes this issue.Paeon
U
4

For https connections try installing the "Git Credential Store" (an "optional" step in the BitBucket tutorial).

This is how to install it:

  1. Download git-credential-winstore.exe from http://gitcredentialstore.codeplex.com/
  2. Open the Git Bash Shell and change the current directory to where git-credential-winstore.exe is located
  3. Run ./git-credential-winstore -i /bin/git
Unpracticed answered 19/1, 2014 at 13:12 Comment(0)
F
4

Try to use git fetch in order to reenter and update the outdated password.

I had the similar issue. The cached password become invalid due to updating the actual password to new one. But git didn't ask me for reentering the valid password and just gave me an error that Authentication failed while I was trying to pull changes.

But magically, git asked me for the actual password when I typed git fetch instead of pulling the data. Once I entered the new password, apparently git updated the old one in its credentials storage and no longer asked me about the entering password again.

Frijol answered 26/8, 2016 at 8:44 Comment(0)
F
4

FIX IT (09/2020)

All the the answers here are wrong... You shouldn't NEVER do something like that:

https://username:PASSWORD@Bitbucket.org

SOLUTION All you have to do is:

  • Go to Sourcetree -> Preferences -> Git
  • You will have the section "Git Version" with 2 options: Reset to ebedded Git and Use System Git

Sourcetree use the Ebedded git for default. Click on "Use System Git" and.... Fixed!


Follow me on: GIthub Twitter

Foreshore answered 18/9, 2020 at 8:57 Comment(1)
Alternatively you can try updating the Embedded version. Either worked for me.Doublethink
G
2

I had the same problem with the Android Studio Chipmunk 2021.2.1 Patch 2 integrated version control. Additionally I have BitBucket and GitHub ssh keys setup on my Windows PC. I was able to fix the issue by setting checked Use credential helper in File | Settings | Version Control | Git

enter image description here

Grizel answered 7/9, 2022 at 7:10 Comment(0)
S
1

In my case, the problem was with the global file .gitconfig on Windows.

When I tried to use solution provided by @jsarroyo in Git BASH, I got an error saying that the file .gitconfig.lock did not exist. I could find no way to fix it.

When I completely removed .gitconfig, everything worked fine.

WARNING: This way, you lose all your git settings and you need to configure it again.

Stonedeaf answered 4/10, 2016 at 9:42 Comment(0)
V
1

In your project go to .git/config and add after username :password

before : https://[email protected]/repo.git

afetr : https://username:[email protected]/repo.git

Versus answered 4/4, 2022 at 7:55 Comment(0)
M
0

In my case, it was just a wrong password for bitbucket entered into the prompt dialog. When I entered the correct password, the error disappeared.

Myxomycete answered 20/11, 2018 at 19:56 Comment(0)
C
0

If you are using android studio you might want to try enabling "Use credential helper".

Steps:

  1. Go to File -> Settings -> Version control -> Git
  2. Find "Use credential helper" option (mostly at bottom)
  3. Enable this option by marking the checkbox before the option
Cherilyncherilynn answered 6/8, 2022 at 9:15 Comment(0)
F
-2

I got this issue when I upgraded from Windows 7 to 8 and settings messed up for me too. I had to regenerate private and public keys, and change my TortoiseGIT to use plink, instead of SSH.exe

I wrote step by step instructions at http://techblog.saurabhkumar.com/2015/09/using-tortoisegit-on-windows-with.html

Fineberg answered 11/9, 2015 at 3:3 Comment(2)
Please don't post link-only answers to your own site. Instead, put the essential information in your answer itself. See: What signifies “Good” self promotion?Offset
Link is dead, by the way.Pauperism
R
-2

For Bitbucket If you are ok for the repo to be public you can just uncheck the "This is a private repository" checkbox in repo settings. Now a simple git clone should work.

Radie answered 18/9, 2020 at 8:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.