Authentication error when uploading file to repository on Github


Well, I followed the steps on this link , but when I get to git push -u origin master it asks for the git username and password in a windows forms, then it asks for the user (2 line), and asks for the SSH password and I haven't even set it up this password and I'm using https. The SSH key is created.

Fatal: AggregateException encountered.
Username for '': letarzan
remote: Invalid username or password.
fatal: Authentication failed for ''

What can it be?

Git remove -v:

origin (fetch)
origin (push)


There can be different reasons for this error:

  • Your username or password is incorrect. To be on the safe side, remove your credentials for accessing Github on Windows via Credential Manager and try again.
  • You have enabled two-factor authentication on your Github account. In this case you need to generate an access token .
  • You are not a repository contributor.

In some cases it could be a problem with the configuration of Git installed on your machine. A clean install or upgrade from Git might do the trick.

Scroll to Top