## Connection via HTTP/HTTPS

### Use KDE wallet

To store passwords in the KDE wallet, you need to install ksshaskpass package:

Then configure git to use it:

Alternatively you can use GIT_ASKPASS environmental variable (in .xinitrc for i3):

If you use KDE, you may set the environmental variable by making a script ~/.config/plasma-workspace/env/askpass.sh, as suggested by Arch Wiki.

### Temporarily store passwords in memory

You can temporarily store passwords in memory by using credential helper:

By default credentials are stored for 15 minutes, to change number of seconds to cache credentials use timeout parameter (30 minutes in this example):

To clear credentials cache before time out execute command:

## Connection via SSH

The methods aforementioned, configuring .gitconfig, does not work for ssh connections (to github/gitlab). To avoid repeating passphrase, we have to set up ssh-agent correctly.

### i3

Since i3 is not like desktop environments, like KDE/Gnome, which provide a complete set of tools. Thus, we have first install a keyring/keychain tool to store passwords. Here we use kwallet from KDE as an example.

Firstly, install kwallet and ksshaskpass packages: (you may also install kwalletmanager as a GUI manager for passwords)

Then, we need to configure ssh-agent to connect to kwallet to retrieve passphrases:

• To run ssh-agent when X starts, add it in .xinitrc:

• We then need to add the RSA keys to ssh-agent and ask ssh-agent to contact kwallet for passphrases. Create a script called ssh-add.sh, for example, containing the following:

• Run ssh-add.sh whenever i3 starts by configuring ~/.config/i3/config (you may have to change the path of the script):

### KDE

In KDE, the configuration will be way easier, since the packages have been installed and almost configured correctly.

Add the script ~/.config/autostart-scripts/ssh-add.sh:

Remember to make it executable by chmod +x ssh-add.sh.

As suggested by Arch Wiki, you may set the environmental variable SSH_ASKPASS separately via a script ~/.config/plasma-workspace/env/askpass.sh:

This should be enough. However, some distributions, like Kubuntu, do not start ssh-agent automatically. You may have to start it by adding eval \$(ssh-agent -s).