Cannot push to my repos

Hi,
I’ve been using git for years but recently I helped a friend create a gitlab account and repo while on my pc.
I created an ssh key for her as well.
Now, I can no longer push to any of my own repos, because ssh identifies me as her…
My user id is : gratefulfrog
but ssh -T git@gitlab.com returns:

$ ssh -T git@gitlab.com
Welcome to GitLab, @lilianeleben!
$ 

For the life of my I can’t seem to fix this.

Any help would be greatly appreciated.
Cheers,
Bob

It looks like git is using her ssh key instead of yours.

You can either delete her key (since it is your PC) or you can tell git which private key to use.

Do this on a per repo basis with

git config --local core.sshCommand "/usr/bin/ssh -i /home/me/.ssh/id_rsa_foo"

Or globally by creating an ~/.ssh/config file.

See https://stackoverflow.com/questions/6688655/select-private-key-to-use-with-git#35351473 for more information.

Hope this helps!

1 Like

Thanks for the help! I’ll try it and let you know!

1 Like

Thanks so much for sharing your solution @byarbrough!