To get a detailed workaround on setting up git and the SSH keys errors that may arise, I prepared a comprehensive Blog on this on Median. You can find it using this link
The Blog covers;
Generating a New SSH Key Pair. I believe this is where you might be having some challenges.
Adding the SSH key generated to a GitLab account. This steps apply to a GitHub account too.
NB: A more detailed step by step approach has been explained on the Diving into GitLab Blog