Tips:
- https://stackoverflow.com/questions/21615431/git-pushes-with-wrong-user-from-terminal
- https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
- Note, sometimes an additionl step is needed to “Enable SSO” on the github page
- https://help.github.com/articles/caching-your-github-password-in-git/
- https://stackoverflow.com/questions/15381198/remove-credentials-from-git
- This showed how to delete generic credentials credentials stored on the machine
- In cases when 2FA is required one needs to add a personal access token.
- We can create one by ourselves following the steps above.
- As an alternative, we can install ‘Git Credential Manager for Windows’. After installing the credential manager, you will be able to ‘git-credential-manager.exe’ in your git folder (libexec\git-core) . This makes things much easier.
I recently had to figure out how to save my git credentials, so i wouldn’t have to keep typing them repeatedly.
The references below helped me get past the issue. Some notes below:
Notes:
- The credentials are set separately for each repo.
- Read the documentation that is provided with “git help credentials”
- “Credential helpers, on the other hand, are external programs from which Git can request both usernames and passwords; they typically interface with secure storage provided by the OS or other programs.”
- I ended up using a Credential manager
- I installed the Git Credential manager for Windows.
- Initially the command “git config –list” did not have a ‘credential.helper’ set
- As mentioned in the reference #2, i set it by using : git config credential.helper manager.
- After doing this, I could save my username and password and avoid the repetiotion

References:
-
$ git help credentials. <--
Read this! Very Useful - https://github.com/Microsoft/Git-Credential-Manager-for-Windows