This question already has an answer here:

Storing git credentials with the command:

git config credential.helper store

stores them unencrypted in a plain text under ~/.git-credentials.

In MacOS and Windows, GitHub Help suggests to use keystores which encrypt your credentials using osxkeychain and wincred respectively. In Linux however there is no mention about how to encrypt your git credentials. Are you aware of a way on how to do that ?

marked as duplicate by waltinator, Eric Carvalho, David Foerster, Eliah Kagan, αғsнιη Apr 28 '18 at 6:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • As an alternative you can authenticate with your ssh key which is more secure – daumie Jul 9 '16 at 14:56
  • @daumie how is it more secure? access_token are giving access only to git over http, not ssh, it is made to expire and be renewed. It is as much portable as an access_token except it is harder to remember by hearth. – Dimitri Kopriwa Oct 3 '18 at 4:57

This was answered here: What is the correct way to use git with gnome-keyring and http(s) repos?

Quoting the answer:

You need to setup the git credential helper with Gnome Keyring:

Install and compile the Gnome Keyring devel:

sudo apt-get install libgnome-keyring-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/gnome-keyring

And setup the credential:

git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring
  • Once in a while I have to reenter creds. Probably after restart of machine – rofrol Oct 5 '17 at 12:17
  • 1
    If your answer is essentially a referral to another question, it would be better to flag this question as a duplicate of the other once you earned 15 reputation. If you have the reputation don’t forget to vote for the answer(s) there that you found useful! – David Foerster Apr 27 '18 at 20:45
  • Especially as the library itself is deprecated. – Joshua Cook Mar 18 at 21:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.