title: git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository
body: <p>I am using macOS Catalina. <strong>I already have a repository on GitLab and an <code>SSH-key</code> assigned.</strong> Now I want to create another repository from the terminal. I do the following:</p>
  
  <pre><code>git config user.name my_name
  git config user.email my_email
  git init
  </code></pre>
  
  <p>Then I get this:</p>
  
  <pre><code>Initialized empty Git repository in directory
  </code></pre>
  
  <p>So far so good.</p>
  
  <pre><code>git remote add origin git@gitlab.com:my_name/repo.git
  git add .
  git commit -m 'commit'
  git push -u origin master
  </code></pre>
  
  <p>Then I get the following error:</p>
  
  <pre><code>git@gitlab.com: Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  
  <p>Then I go to the repository I already had and try to push there, everything works so I guess I don't have a problem with <code>SSH-key</code>. I know this is a very common question on the internet but none of the answers solved my problem.</p>