Follow these steps:
- Generate a new SSH key (if needed): Generate a new one using the following command, replacing with your GitHub email using this command in your git bash:
$ ssh-keygen -t ed25519 -C "your primary email at GitHub" - When prompted to "Enter a file in which to save the key", just press Enter to accept the default location. You can also press Enter for an empty passphrase.
- Add your public key to GitHub:
- Copy the content of your public key file to your clipboard. Use this command for your Windows system , Windows (Git Bash):
$ clip < ~/.ssh/id_ed25519.pub - Go to to your GitHub Repository which you want to clone, in your GitHub in the browser.
Click on the 'Settings' tab and scroll down the left hand menu to "Deploy keys". - Click Add Deploy key, give it a descriptive title, and paste the copied key into the "Key" field. Click Add SSH key.
- Ensure your SSH agent is running and has the key loaded, search git in search bar in the taskbar of your PC, in the pop-up window choose "run as administrator". Now in the git bash console cd to your project folder and Start the SSH agent in the background by these two commands:
First start the 'ssh-agent' in the background:
$ eval "$(ssh-agent -s)"
Then add your private SSH key to the agent:
$ ssh-add ~/.ssh/id_ed25519 - Now to clone your remote GitHub repository to your local project directory, cd to your project directory and give this command:
$ git clone <URL of your remote repo copied from GitHub>
No comments:
Post a Comment