I git push my work to a remote Git repository.
Every push will prompt me to input username and password. I would
You can use the git-credential-store via
git config credential.helper store
which stores your password unencrypted in the file system:
Using this helper will store your passwords unencrypted on disk, protected only by filesystem permissions. If this is not an acceptable security tradeoff, try git-credential-cache, or find a helper that integrates with secure storage provided by your operating system.
Use the git-credential-cache which by default stores the password for 15 minutes.
git config credential.helper cache
to set a different timeout, use --timeout (here 5 minutes)
git config credential.helper 'cache --timeout=300'
- If you’re using a Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account. This method stores the credentials on disk, and they never expire, but they’re encrypted with the same system that stores HTTPS certificates and Safari auto-fills. Running the following on the command line will enable this feature:
git config --global credential.helper osxkeychain. You'll need to store the credentials in the Keychain using the Keychain app as well.- If you’re using Windows, you can install a helper called “Git Credential Manager for Windows.” This is similar to the “osxkeychain” helper described above, but uses the Windows Credential Store to control sensitive information. It can be found at https://github.com/Microsoft/Git-Credential-Manager-for-Windows. [emphases mine]