How to store credentials in Git

So, you don’t want to enter your username and password each time you issue a git command in your terminal. There is a way to save your credentials on your PC’s disk in plaintext.

run

git config --global credential.helper store

then

git fetch

It will ask you for your username and password one last time and save it for your future commands.

And if you want to clear saved credentials, then do this.

git config --global --unset credential.helper