- Loading...
...
| Code Block | ||
|---|---|---|
| ||
$ git token store https://github.com Username: <insert your Github username> Password: <insert your "Personal Access Token", not your GitHub password> |
On The credential manager you will use on GNU/Linux to the way you will store the personal access token you are about to generate depends on your desktop environment. If you are using the a desktop environment with support for the GNOME Keyring, then follow the instructions in the GNOME Keyring section. If you are using a GNU/Linux installation without a desktop environment or with (e.g. when using SSH to connect to a server) or a desktop environment that does not support the GNOME Keyring , see the Other section for instructions.
(e.g. XFCE, KDE, i3), then you need to pick a credential manager that suits your security and usability needs. The following sections will present four common choices for storing personal access tokens when you are unable to use GNOME Keyring:
On GNU/Linux installations that features the GNOME Keyring On GNU/Linux the recommended setup is to use libsecret and the "libsecret credential helper" in order to use GNOME Keyring as the Git credential manager . Please follow the instructions for setting up libsecret for the GNU/Linux distribution you are using, then proceed to generate a personal access token.
Fedora
Fedora 29 30, 31 and 30 32 comes with libsecret and GNOME Keyring installed by default. When you install the git package you also get the libsecret credential helper automatically installed. To configure git to use the libsecret credential helper run the following command:
| Code Block | ||
|---|---|---|
| ||
$ git config --global credential.helper /usr/libexec/git-core/git-credential-libsecret |
...
| Code Block | ||
|---|---|---|
| ||
sudo dnf install seahorse |
Ubuntu
Ubuntu 19.04 10 and 18.04.2 4 (LTS) comes with libsecret and GNOME Keyring installed by default. Unfortunately even if you install the Git package you will not get a binary version of the libsecret credential helper installed (you only get the source). This means you have to compile the libsecret credential helper yourself. This is easy to do, it just requires two extra Compile the libsecret credential with the following two commands:
| Code Block | ||
|---|---|---|
| ||
$ sudo apt install libsecret-1-dev $ sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret |
...
| Code Block | ||
|---|---|---|
| ||
$ sudo apt install seahorse |
To generate a a Personal Access Token on GitHub go to https://github.com/settings/tokens and and click on "Generate new token". You only need to select the "repo" scope (permission). After you have generated your token, store it in the GNOME Keyring using git token store:
...