Saturday, December 13, 2025

How to clone your remote GitHub repository to your local git:



Follow these steps:
  1. 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"

  2. 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.
  3. 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.
  4. 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

  5. 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

Python Dictionary

  Removing Dictionary Items Dictionary items can be removed using built-in deletion methods that work on keys: del :  removes an item using ...