git-shallow-clone-orb icon indicating copy to clipboard operation
git-shallow-clone-orb copied to clipboard

Setting git config to use ssh instead of https breaks cloning from public repositories

Open Pi-George opened this issue 2 years ago • 1 comments

This line in git clone shallow:

git config --global url."ssh://[email protected]".insteadOf "https://github.com" || true

Is causing composer install to fail with:

[RuntimeException]                                                                                           
  Failed to clone https://github.com/Pi-George/laminas-file.git via https, ssh protocols, aborting.            
                                                                                                               
  - https://github.com/Pi-George/laminas-file.git                                                              
    Cloning into bare repository '/root/.cache/composer/vcs/https---github.com-Pi-George-laminas-file.git'...  
    [email protected]: Permission denied (publickey).                                                             
    fatal: Could not read from remote repository.                                                              
                                                                                                               
    Please make sure you have the correct access rights                                                        
    and the repository exists.                                                                                 
                                                                                                               
  - [email protected]:Pi-George/laminas-file.git                                                                  
    Cloning into bare repository '/root/.cache/composer/vcs/https---github.com-Pi-George-laminas-file.git'...  
    [email protected]: Permission denied (publickey).                                                             
    fatal: Could not read from remote repository.                                                              
                                                                                                               
    Please make sure you have the correct access rights                                                        
    and the repository exists.        

Also worth noting, checkout is checking out a bitbucket repo, not a github repo.

Pi-George avatar Feb 07 '22 16:02 Pi-George

Need more info, including reproduce step would be appreciated.

guitarrapc avatar Sep 18 '23 19:09 guitarrapc