Alex Braga
Alex Braga

Reputation: 545

Github started asking for password in terminal for every "git push" after "git push origin +HEAD"

Before anything else: I'm aware of the difference between SSH and HTTPS in this case. I usually create and manage my repos from IntelliJ or VS Code, but even when manually pushing to a remote from the terminal my credentials were never required, even though all my repositories use HTTPS. In fact, yesterday I was using a terminal window to push my commits to a given remote repository and it didn't ask me for anything. Today I needed to do a git push origin +HEAD to this very same repository, it asked for my username and password (PAT), and now every time I want to push anything it prompts me for the password.

I'm on Linux.

Upvotes: 3

Views: 1621

Answers (1)

Eng_Farghly
Eng_Farghly

Reputation: 2997

You should config cache credential for linux

git config --global credential.helper cache

The previous command will cache the credentials for some time (default 15 minutes)

If you want to store the credentials for ever

git config --global credential.helper store

For more information view this answer

Upvotes: 1

Related Questions