Unable to push: remote: invalid username or password


#1

Atom is prompting me to login everytime I try to push something to my remote.
I’m 100% sure I enter my correct credentials since I’ve tested multiple times logging in inside a web browser.

Atom however is saying that my credentials are wrong, I have no idea why.

I’ve had this problem in the past, but I guess it was fixed by re-logging in whenever the login prompt pops up, which is not the case now.


#2

What happens if you try to git push from the command line?


#3

Command line and other interfaces work fine, I get this problem only from atom.


#4

Can you please past the result of apm -v and apm ls | grep "git" (assuming non-Windows), so we can see core & package versions. Be sure to mark it as code using the </> button.

How often did it happen? Was it everytime you closed and opened a new window?


#5

I’m using Windows.

How often did it happen?

I can’t say for sure because I think it was a month ago when I last encountered the problem. Around that time though (1-2 months ago), its frequency varied from something around every 2-3 days to a week.
I’m not sure what’s causing it to forget my credentials or my token (on that note, I can’t remember if it was a token because this time, it doesn’t give me the option to login using a token).

Was it everytime you closed and opened a new window?

I can’t remember for sure. There may have been times when this happened, but from what I remember, it usually took a few days before atom forgets my login.


After trying to push, this windows pops up
image

After I enter my correct credentials, this pops up

remote: Invalid username or password
fatal: Authentication failed for 'https://......'

#6

I’m not sure what’s causing it to forget my credentials or my token (on that note, I can’t remember if it was a token because this time, it doesn’t give me the option to login using a token).

Do you have 2FA enabled on your GitHub account? If so, you do need to use a personal access token rather than your password - you can just enter the token in the Password field.


#7

Indeed, using the token worked. It still asks me to login everytime I push though.


#8

Glad that helped :+1:

It still asks me to login everytime I push though.

Is that the case on the command line too?


#9

Only for atom.

It’s fine on Github Desktop, PyCharm and command line.