Skip to content

Instantly share code, notes, and snippets.

@JonasGroeger
Forked from maelvls/README.md
Last active April 29, 2024 05:50
Show Gist options
  • Save JonasGroeger/4393203cc846da558fec1531cdd822db to your computer and use it in GitHub Desktop.
Save JonasGroeger/4393203cc846da558fec1531cdd822db to your computer and use it in GitHub Desktop.
Guide: How to install git-credential-helper / libsecret in Debian / Ubuntu

Storing your GIT credentials in libsecret

# Install dependencies
$ sudo apt install make gcc git libsecret-1-0 libsecret-1-dev libglib2.0-dev

# Compile binary
$ sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret

# Configure git to use binary as credential storage
$ git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

The last command will create an entry in the global ~/.gitconfig file:

$ cat ~/.gitconfig 
[credential]
	helper = /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

Next, create a personal access token (PAT) with read_repository and write_repository permissions. Use the PAT as the password. The username can be arbitrary but I recommend to use the PAT name to avoid confusion later.

Everything is in place now. After the first git clone, a second git clone should work without authentication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment