1

I've created an SSH key and when I run ssh -T git@gitlab.com in GitBash as admin I get Welcome to GitLab, @myname so that's working, but the moment I run the same within a directory where all my files that i'm trying to push to an empty git project I get git@gitlab.com: Permission denied (publickey).

I've read the docs but cant figure out what I'm doing wrong why does it work in the root of the PC and not in the folder where I actually have the file I need to send to git?

Working

My.Name@My-Mac MINGW64 ~
$ ssh -T git@gitlab.com
Welcome to GitLab, @joshwordshop!

Not working

My.Name@My-Mac MINGW64 /c/blah/blah/blah/blah/blah/blah(master)
$ ssh -T git@gitlab.com
git@gitlab.com: Permission denied (publickey).

NOTE: Running windows on a Mac so if you post any commands can you do so in their windows form, thank you in advanced

woshj
  • 11
  • 2
  • You need to go through a couple of checks... e.g. which credentials are set (see in `git config --local -l`). This [question](https://stackoverflow.com/q/4565700/4183044) might have useful information on your ssh-key usage – roxch Dec 07 '19 at 00:01

1 Answers1

0

Have you added your publickey to your GitLab profile? You can find those settings under: Profile -> SSH Keys

You can find more instructions inside GitLab's documentation here