- Save logins in the macOS Keychain
git config --global credential.helper osxkeychainNext time Git asks, enter your GitHub username and a personal access token (not your password). It's remembered after that.
- Create a personal access token
open https://github.com/settings/tokens/new
Check it worked
- Check the setting
git config --global credential.helper
Undo it
- Stop saving logins
git config --global --unset credential.helper
- Remember your login for 8 hours at a time
git config --global credential.helper 'cache --timeout=28800'Kept in memory only, never written to disk. Enter your username and a personal access token (not your password).
- Create a personal access token
xdg-open https://github.com/settings/tokens/new
Check it worked
- Check the setting
git config --global credential.helper
Undo it
- Stop saving logins
git config --global --unset credential.helper
- Use Git Credential Manager (comes with Git for Windows)
git config --global credential.helper managerNext time Git asks, a browser window opens to sign in to GitHub. It's remembered after that.
Check it worked
- Check the setting
git config --global credential.helper
Undo it
- Stop saving logins
git config --global --unset credential.helper