I ran into a very peculiar problem with Git. I have a repository on a Gitlab server and I usually work on it from my work computer in the office (which runs Ubuntu). On there, I have set up a private/public key and everything works just fine.
Now the weird part is, when I ssh into my work computer from home and execute a pull, or push, or any other Git command requiring connection to the Gitlab server, I get an error, saying that my public key is wrong.
$ git push
git@collaborating.tuhh.de: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
From my understanding, if I ssh into my work computer and execute a command in the shell, it should be exactly as if I am running that same command directly sitting in front of that computer, shouldn't it?
Does anyone have an idea, why this goes wrong? Any ideas welcome!