I use GitLab repositories with two users (myself and a test user). For my test repository I have this in .git/config:
[core] sshCommand = ssh -i /test-project/test_id_rsa [remote "origin"] url = email@example.com:test.tester/test-repo.git
And I don't use a passphrase at all with test_id_rsa.
'git pull', etc. works fine, but only when keychain is not running. When keychain is running, it seems my usual SSH key gets used, and Git commands will not work, as I come across as wrong key pair is used.
lynoure@laptop:~/repo$ ssh -i ~/.ssh/a_test.tester_key firstname.lastname@example.org Welcome to GitLab, test tester! Connection to gitlab.example.com closed.
I start keychain with the shell, by:
eval `keychain --eval --agents ssh id_rsa
When I have started keychain:
lynoure@laptop:~/repo$ ssh -i ~/.ssh/a_test.tester_key email@example.com Welcome to GitLab, Lynoure! Connection to gitlab.example.com closed.
Is there some way I can avoid needing to disable keychain every time I use my test-repo in the tests?