7

I've just updated from Git 1.7.11 to 1.8.5

Now when trying to push to bitbucket I'm getting the following message:

fatal: could not read Password for 'https://xxxxxx@bitbucket.org': No such file or directory

Where xxxxx is my username.

Pushing on other machines which are still on 1.7 is working ok.

What would cause this and how can I fix it?

Chris Nevill
  • 5,922
  • 11
  • 44
  • 79

4 Answers4

9

It is a bug in 1.8.5.2 msysgit (1.8.5.2-preview20131230). See the report and a discussion with a way to workaround

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
  • I've created an [unofficial fix release (1.8.5.4)](https://github.com/nevik/git/releases/tag/v1.8.5.4.msysgit.nevik.0) 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. – Nevik Rehnel Feb 09 '14 at 18:54
4

try:

git remote add origin https://username:password@bitbucket.org/repo.git

obviously for username put your username

password put your password

adbarads
  • 1,253
  • 2
  • 20
  • 43
2

Not necessarily the best answer - but in the end I resolved this by removing/uninstalling git altogether and then reinstalling.

I have no idea why I needed to do this. At present I've reinstalled 1.7. I'll try an update again sometime and update this post.

Chris Nevill
  • 5,922
  • 11
  • 44
  • 79
  • Never ever use the installer. Always unzip the archive in a separate path and adjust `%PATH%` accordingly: http://code.google.com/p/msysgit/downloads/list?can=3&q=portable&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount – VonC Jan 02 '14 at 14:02
  • 2
    @VonC And that recommendation is based on what argumentation? – poke Jan 02 '14 at 14:06
  • 1
    @poke On Windows, you want to work only with *portable* software: no registry modification, no environment variable modified without your knowledge/consent, and the ability to fall back to the previous -- untouched -- git installation if the new one behave badly. Plus the installer has (or had) the nasty habit to set for you the `core.autocrl` global Git config to true. I have 4 years worth of answers explaining why this isn't a good idea (like http://stackoverflow.com/a/2354278/6309). – VonC Jan 02 '14 at 15:32
  • 1
    *“you want to work only with portable software”* – No idea where you get this from, but I absolutely disagree. And the installer gives you configuration options to exactly specify if the environment should be modified etc.; it also lets you choose whether or not to enable `autocrlf`. Issues from the past are not relevant. The installer is definitely the recommended way to install “Git for Windows”. – poke Jan 02 '14 at 16:09
0

Just taking a blind shot here, but are you able to re-add the remote without the username in the URL? I know in the old Git version, you needed to specify the username and password inline, but in the newer versions, it prompts you for the username and password if required.

git remote add origin https://bitbucket.org/repo.git
jaseeey
  • 281
  • 4
  • 15
  • Thanks for the reply. Using that command I get the response: fatal:remote origin already exists – Chris Nevill Jan 02 '14 at 12:06
  • You will need to remove the current origin first, before trying to add it again - I should have mentioned: git remote rm origin – jaseeey Jan 02 '14 at 12:06
  • OK just tried removing and then adding without a username, but unfortunately no dice. Still comes up with the 'No such file or directory' – Chris Nevill Jan 02 '14 at 12:07
  • 1
    'fatal: could not read Username for 'https://bitbucket.org': No such file or directory' – Chris Nevill Jan 02 '14 at 12:09
  • Hmm, are you able to try cloning the repository to a new location using the link provided on BitBucket? Does that work? – jaseeey Jan 02 '14 at 12:18
  • Clone also comes back with 'fatal could not read password' 'No such file or directory' :/ – Chris Nevill Jan 02 '14 at 12:25
  • OK, what OS are you using? How did you go about upgrading to Git 1.8.5? Did you also upgrade the dependencies (i.e. perl-Git)? – jaseeey Jan 02 '14 at 12:27
  • I'm on Windows and just visited http://git-scm.com/ downloaded the exe and ran through it – Chris Nevill Jan 02 '14 at 12:29
  • About as far as I can go for the moment. If there's no success in the next 12 hours, I'll give it a crack when I'm at work on my Windows machine and try to reproduce the problem for you. – jaseeey Jan 02 '14 at 12:57
  • No worries, thanks for trying. I ended up uninstalling and reinstalling git and this seems to have fixed it for the time being. I don't understand why at this point. – Chris Nevill Jan 02 '14 at 14:00
  • It could have changed the environment variables or modified something partially. A full re-install would have fixed this, but I would still be keen to find out what actually went wrong for future reference. – jaseeey Jan 02 '14 at 14:08