How do I pull my project from github?

后端 未结 6 900
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 19:39

I have a project on github that I have been working on before. However, I wiped out my computer and I am wondering which git command should I invoke under my username to checko

6条回答
  •  清酒与你
    2021-01-29 20:19

    Since you have wiped out your computer and want to checkout your project again, you could start by doing the below initial settings:

    git config --global user.name "Your Name"
    git config --global user.email youremail@domain.com
    

    Login to your github account, go to the repository you want to clone, and copy the URL under "Clone with HTTPS".

    You can clone the remote repository by using HTTPS, even if you had setup SSH the last time:

    git clone https://github.com/username/repo-name.git
    

    NOTE:

    If you had setup SSH for your remote repository previously, you will have to add that key to the known hosts ssh file on your PC; if you don't and try to do git clone git@github.com:username/repo-name.git, you will see an error similar to the one below:

    Cloning into 'repo-name'...
    The authenticity of host 'github.com (192.30.255.112)' can't be established.
    RSA key fingerprint is SHA256:nThbg6kXDoJWGl7E1IGOCspZomTxdCARLviMw6E5SY8.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of known hosts.
    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    Using HTTPS is a easier than SSH in this case.

提交回复
热议问题