My Profile Photo

Just a non-geek


Just another blog of a try-not-to-be a geek


Git credentials in Linux for anyone

So I work daily with git, especially with different git repos (gitHub and gitLab). And typing a password every time for a pull/push is a nightmare. So I google-up a little bit and find out quite a nice solution got my problem (using libsecret as a credential manager). So here are needed steps to set it up. First, you will need to install libsecret-1-0 (and libsecret-1-dev).

On Ubuntu (and similar derivates) you can use the following command

geek@home:~$ apt-get install libsecret-1- libsecret-1-dev

and in ManjaroLinux you can find this package in Package Manager.

After installation, you will need to build the credential manager (:S).

On Ubuntu, you can use following command:

geek@home: cd /usr/share/doc/git/contrib/credential/libsecret 
geek@home:~$ make

In ManjaroLinux the libsecret is in different directory:

geek@home: cd /usr/share/git/credential/libsecret/
geek@home:~$ make

Finally, you should point git to use libsecret as credential helper:

For Ubuntu:

geek@home: git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

For ManjaroLinux:

geek@home: git config --global credential.helper /usr/share/git/credential/libsecret/git-credential-libsecret