Gitfox Gitfox

Authentication via SSH

If you are using SSH for authentication, Gitfox works like regular git from the commandline without extra configuration (the exception are keys with passphrases, see below).

If your remote URL looks something like this, you are using SSH

git@github.com:golang/go.git

Please note that Service Accounts are only used for HTTPS authentication, not SSH.

Private Keys with Passphrases

If your private key has a passphrase, Gitfox won’t prompt you to enter it. You can tell your ssh-agent to store your password in your keychain for you, without requiring password entry on connection. To do that, please add the following lines to your ~/.ssh/config file

Host *
UseKeychain yes
AddKeysToAgent yes

This will configure all hosts to store your passphrases in your keychain. If you just want to store it for a single host, consider something like this

Host example.com
IdentityFile path/to/private_key
UseKeychain yes
AddKeysToAgent yes

For the ssh-agent to remember your passphrase, add your private key to the agent once and enter the passphrase for it.

For macOS 12.0 or newer use:

ssh-add --apple-use-keychain path/to/private_key

for macOS versions below 12.0 use:

ssh-add -K path/to/private_key

Using multiple SSH keys

If you have a setup that requires multiple SSH keys (not recommended), you’ll have to correctly configure your SSH client to do so.

You can configure this in the ~/.ssh/config file. For instance here we configure 2 seprate SSH keys for a private and work account:

Host private.github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_private

Host work.github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_work

For Gitfox to pick up the correct SSH key, you would then have to change your remotes url to the appropriate host, like e.g. git@work.github.com:user/repo.git

That way, SSH will use the correct key for you repo.