Skip to content

Git Credential Manager on Arch Linux (Codeberg + VSCode)

Requirements

  • Arch Linux with a display manager (SDDM)
  • Wayland compositor (niri, Hyprland, etc.)
  • Codeberg account with an access token

1. Install GCM

Terminal window
yay -S git-credential-manager

2. Run GCM setup

Terminal window
git-credential-manager configure

3. Install gnome-keyring

Terminal window
sudo pacman -S gnome-keyring libsecret

4. Enable keyring daemon via systemd

Terminal window
systemctl --user enable --now gnome-keyring-daemon.socket

5. Configure PAM for auto-unlock on login

Check /etc/pam.d/sddm-autologin — it should already contain these lines (added by gnome-keyring package). If not, add them:

-auth optional pam_gnome_keyring.so
-session optional pam_gnome_keyring.so auto_start

6. Configure Git

Terminal window
git config --global credential.credentialStore secretservice
git config --global credential.guiPrompt false # terminal prompt (no GUI)
git config --global credential.https://codeberg.org.provider generic
git config --global credential.https://codeberg.org.username YOUR_CODEBERG_USERNAME

Final ~/.gitconfig credential section

[credential]
helper =
helper = /usr/bin/git-credential-manager
credentialStore = secretservice
guiPrompt = false
[credential "https://dev.azure.com"]
useHttpPath = true
[credential "https://codeberg.org"]
provider = generic
username = YOUR_CODEBERG_USERNAME

7. Reboot

Terminal window
reboot

On first login after reboot, you will be prompted to set a password for the keyring. Set one — it unlocks automatically on subsequent logins via PAM.


8. Test

Clone a Codeberg repo. When prompted, enter:

  • Username: your Codeberg username
  • Password: a Codeberg access token (Settings → Applications → Generate Token, with repository scope)

On the second operation, no prompt should appear — credentials are stored in the keyring.


Verify stored credentials

Terminal window
secret-tool search server codeberg.org