I know SSH in GitHub causes no problem (no username/password to type everytime i.e.), but I need to use HTTPS for a repo of mine.
Now, I git init
ed the rep
Your GitHub password won't work if you have activated the two-factor authentication.
You need to generate a Personal Access Token, as I explain in "Configure Git clients, like GitHub for Windows, to not ask for authentication".
That long (40 characters) password will work as your GitHub password without requiring a second authentication.
The difference between a PAT (Personnal Access token) and your Github password account:
And you can encrypt your GitHub credential in a .netrc.gpg
file, as I illustrate in "Is there a way to skip password typing when using https:// github".
I find that far superior to a memory-caching mechanism (like credential-osxkeychain), since you don't have to type your GitHub (long and complex token) password at each session.
You only type the passphrase of your gpg key, for that GitHub login/token credential, or for any other credential that you have encrypted in your ~/.netrc.gpg
file.