If you want to save your git passwords permanently then use this snippet.
git config --global credential.helper store
This saves the password as a plain text file on the computer with the name .git-credentials
. Anyone else using your computer can also see your password.
Refer: git credential store