2

I haven't got what to enter in fields Username for and Password for after the command git push heroku master:

C:\code2015>git push heroku master
Username for 'https://git.heroku.com': nemo
Password for 'https://nemo@git.heroku.com':
remote: !       WARNING:
remote: !       Do not authenticate with username and password using git.
remote: !       Run `heroku login` to update your credentials, then retry        
the git command.
remote: !       See documentation for details:       
https://devcenter.heroku.com/articles/http-git#authentication
fatal: Authentication failed for 'https://git.heroku.com/django-blog.git/'

I have read documents, but do not still understand.

C:\code2015>heroku login
Enter your Heroku credentials.
Email: nemo@yandex.ru
Password (typing will be hidden):
Authentication successful.
MattDMo
  • 100,794
  • 21
  • 241
  • 231

5 Answers5

1

Just to be more definite.

This works for me on Windows 8.
In cmd do:

set HOME=%USERPROFILE%
1

For my situation, I have "identity crises", as I installed git through cygwin, while I used Heroku's toolbelt: heroku login successfully in DOS Command console (CMD).

For CMD, the %HOME% is c:\Users\my-id

for cygwin, $HOME is different

I found that _netrc was placed in both $HOME and %HOME%

I had to

copy $HOME/_netrc $HOME/.netrc then

git push heroku master

succeeded.

Yu Shen
  • 2,770
  • 3
  • 33
  • 48
0

this happens because the home folder isn't the same with the toolbelt and git when finding the _netrc. Can you show me the output of each of the following?

echo %HOME%
echo %HOMEDRIVE%%HOMEPATH%
echo %USERPROFILE%
echo %HOMESHARE%

then you'll need to find out where the _netrc file is, copy it into one of the paths above and find out which is the correct location. Let me know which is the correct one for you.

Jeff Dickey
  • 5,036
  • 4
  • 28
  • 39
  • my all paths are ok (c:/user/me) and there is _netrc created, but somehow GIT doesn't read it ? – razor Apr 15 '15 at 13:24
  • git is looking in a different place for it. I'm not sure how to find out, check each of your env vars with `set` – Jeff Dickey Apr 17 '15 at 17:36
  • it looks like GIT wants to use %HOME% variable. which is not set under Windows. I set %HOME% to the same value as USERPROFILE (the place where _netrc exists) – razor Apr 18 '15 at 18:01
  • `%HOME%` generally isn't set, if it were, everything would work. I want to know what git is using as a fallback when `%HOME%` isn't set. – Jeff Dickey Apr 20 '15 at 14:57
0

I had similar problem,

heroku login

was saving _netrc file at my user directory ( %USERPROFILE%, the same as %HOMEDRIVE%%HOMEPATH% ) but GIT didn't use that (it looks like it reads only %HOME% variable). I set

%HOME% 

variable to the same value (so it is c:\user\<my account>\ now and there is also _netrc file) and GIT started to work

razor
  • 2,727
  • 6
  • 33
  • 45
-1

To have ability to push to heroku git repository you have to login with heroku gem

heroku login

and then you can use regular git commands. Just try again

heroku login
git push heroku master
djsmentya
  • 315
  • 1
  • 12