I run Gitlab CE on my server and use several different user accounts to group my repos by interest. The problem is with SSH.
I found the following solution for github:
https://gist.github.com/jexchan/2351996
In this guide one just uses different hosts with the same hostname in the config. Which is little effort to achieve what I'd like to achieve. But this solution does not work with Gitlab or at least not for me.
This solution is all over the web. One that is less used but is working for me, is this one:
https://gist.github.com/gubatron/d96594d982c5043be6d4
In the second, one assigns subdomain names as hosts in the ssh config with the same hostnames and uses the same subdomains in the git config. Little example:
SSH config:
Host user1.git.mydomain.at
HostName git.mydomain.at
IdentityFile ~/.ssh/id_rsa_user1
Host user2.git.mydomain.at
HostName git.mydomain.at
IdentityFile ~/.ssh/id_rsa_user2
git:
git remote set-url origin admin@user1.git.mydomain.at:user1/foo.git
git remote set-url origin admin@user2.git.mydomain.at:user2/foo.git
One can see, that I have to change every repo url manually. I would like to avoid this, and would prefer the first solution.
Am I missing something important?