how to save password to git config in encrypted format that is is not readable if .gitconfig is opened

StackOverflow https://stackoverflow.com/questions/21507215

  •  06-10-2022
  •  | 
  •  

سؤال

I have made a git command in python, want user to save email password in git config but don't want any user to understand if he opens .gitconfig file !!

هل كانت مفيدة؟

المحلول

git has support for integrating with local keyring/password management utilities; search google for "git (name of your keyring program)". (These are called "credential helpers".)

Alternatively, if your remote is over SSH, you can use public key authentication, along with ssh-agent to remember the password to your private key.

If it's something else entirely that you're storing the password for (the "email password"?), you could consider a similar tactic: integrate with the local keyring manager. I'm not sure if git credential helpers can do this directly for you or not, but you might be able to implement the same side of the protocol as git, and thus use credential helpers that already exist.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top