How do I pull my project from github?

后端 未结 6 1014
佛祖请我去吃肉
佛祖请我去吃肉 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 19:54

    There are few steps to be followed (For Windows)

    1. Open Git Bash and generate ssh key Paste the text below, substituting in your GitHub email address.

      ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

      This creates a new ssh key, using the provided email as a label.

      Generating public/private rsa key pair.

      When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

      Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter]

      At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".

      Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]

    2. Add the key to SSH Agent

      Type the following in Git Bash (99999 is just an example) to see agent is up and running. eval $(ssh-agent -s) Agent pid 99999

      then type this.

      ssh-add ~/.ssh/id_rsa

      then Copy the SSH key to your clipboard using this command

      clip < ~/.ssh/id_rsa.pub

    3. Add the SSH Key to the Git Account

      In GitHib site, click on the image on top right corner, and select settings. In the subsequent page, click SSH and GPG keys option. This will open up the SSH key page. Click on the New SSH key. In the "Title" field, add a descriptive label for the new key. Paste your key into the "Key" field.

    4. Clone the Repository

      Open VS Code (or any IDE/CLI which has command prompt etc.). Go to the directory in which you want to clone, using cd commands, and type the below line. git config --global github.user yourGitUserName git config --global user.email your_email git clone git@github.com:yourGitUserName/YourRepoName.git

    https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

提交回复
热议问题