title: Github Clone error: Could not switch to
body: <p>Im getting a Fatal Error when trying to clone a repo to a new directory. I can't see what I'm doing wrong.</p>
  
  <p>Im on a CentOS server, at the command line running:</p>
  
  <blockquote>
    <p>git clone git@github.com:MYUSERNAME/REPONAME.git newdirectory</p>
  </blockquote>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>fatal: Could not switch to 'git@github.com/MYUSERNAME': No such file or directory</p>
  </blockquote>
  
  <p>newdirectory definitely exists, and the user I am logged in as has write permissions, and also has a github ssh key set up.</p>
  
  <p>If i put something in the newdirectory </p>
  
  <p>Anyone got any ideas I can try? Cheers</p>
  
  <hr>
  
  <p>UPDATE:
  This is what happens if I try SSL based instead of SSH:</p>
  
  <blockquote>
    <p>-bash-4.1$ git clone <a href="https://github.com/MYUSERNAME/REPONAME.git" rel="nofollow">https://github.com/MYUSERNAME/REPONAME.git</a> newdirectory
    Initialized empty Git repository in /var/www/html/newdirectory/.git/
    error: The requested URL returned error: 401 while accessing ><a href="https://github.com/MYUSERNAME/REPONAME.git/info/refs" rel="nofollow">https://github.com/MYUSERNAME/REPONAME.git/info/refs</a></p>
    
    <p>fatal: HTTP request failed</p>
  </blockquote>
  
  <p>I think this is to be expected though, its a private github repo, Im not sure https works for private repos? Part of why I have always used ssh (successfully) in the past.</p>