title: GitLab setting up an ssh key
body: <p>I clone an empty project directory from a project I'm part of, after configuring git global as:</p>
  
  <pre><code>$ git config --global user.name "My Username"
  $ git config --global user.email "myeamil.com"
  
  $ git clone git@gitlab.com:our-projects/this-project.git
  $ cd this-project
  $ touch README.md
  $ git add README.md
  $ git commit -m "add README"
  </code></pre>
  
  <p>Then a follow the steps described <a href="https://gitlab.com/help/ssh/README#generating-a-new-ssh-key-pair" rel="nofollow noreferrer">here</a> to generate and add an <code>ssh key</code> (I actually created an <code>ED25519 SSH keys</code>). But testing to ensure the ssh was correctly added failed. </p>
  
  <pre><code>$ ssh -T git@our-projects/this-project.git
  ssh: Could not resolve hostname gitlab.com:it-porto/transportation-mode-detection.git: Name or service not known
  
  $ ssh -T git@our-projects
  ssh: Could not resolve hostname gitlab.com:it-porto/transportation-mode-detection.git: Name or service not known
  
  $ ssh -T git@this-project.git
  ssh: Could not resolve hostname gitlab.com:it-porto/transportation-mode-detection.git: Name or service not known
  </code></pre>
  
  <p>Content of my ssh key directory:</p>
  
  <pre><code>$ ls /home/user/.ssh/
  id_ed25519  id_ed25519.pub  id_rsa  id_rsa.pub  known_hosts  known_hosts.old
  </code></pre>
  
  <p>How do I fix this?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I did a <code>ssh -T git@gitlab.com</code> as suggested in the comment, a welcome message displayed, but this doesn't seem to work, I cannot <code>git push</code> to the remote.</p>
  
  <pre><code>$ssh -T git@gitlab.com
  Welcome to GitLab, @user!
  
  $git push origin master
  Counting objects: 8, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (6/6), done.
  Writing objects: 100% (8/8), 45.49 KiB | 3.50 MiB/s, done.
  Total 8 (delta 0), reused 0 (delta 0)
  remote: GitLab: 
  remote: A default branch (e.g. master) does not yet exist for our-projects/this-project
  remote: Ask a project Owner or Maintainer to create a default branch:
  remote: 
  remote:   https://gitlab.com/our-projects/this-project/-/project_members
  remote: 
  To gitlab.com:our-project/tthis-project.git
   ! [remote rejected] master -&gt; master (pre-receive hook declined)
  error: failed to push some refs to 'git@gitlab.com:our-projects/this-project.git'
  
  
  $ git remote -v
  origin  git@gitlab.com:our-projects/this-projectt.git (fetch)
  origin  git@gitlab.com:our-projects/this-projectt.git (push)
  </code></pre>