When generating an SSH key, you'll need to add your newly created (or existing) SSH key to the ssh-agent.

Before adding a new SSH key to the ssh-agent, you should have:

Tip: If you used an existing SSH key rather than generating a new SSH key, you'll need to replace id_rsa in the above command with the name of your existing private key file.

  1. Ensure ssh-agent is enabled:

    # start the ssh-agent in the background
    eval "$(ssh-agent -s)"
    Agent pid 59566
    
  2. Add your SSH key to the ssh-agent:

    ssh-add ~/.ssh/id_rsa
    

If you have GitHub for Windows installed, you can use it to clone repositories and not deal with SSH keys. It also comes with the Git Bash tool, which is the preferred way of running git commands on Windows.

  1. Ensure ssh-agent is enabled:

    • If you are using Git Bash, turn on ssh-agent:

      # start the ssh-agent in the background
      eval "$(ssh-agent -s)"
      Agent pid 59566
      
    • If you are using another terminal prompt, such as msysgit, turn on ssh-agent:

      # start the ssh-agent in the background
      eval $(ssh-agent -s)
      Agent pid 59566
      
  2. Add your SSH key to the ssh-agent:

    ssh-add ~/.ssh/id_rsa
    
  1. Ensure ssh-agent is enabled:

    # start the ssh-agent in the background
    eval "$(ssh-agent -s)"
    Agent pid 59566
    
  2. Add your SSH key to the ssh-agent:

    ssh-add ~/.ssh/id_rsa