Install Git Bash and SSH Setup
Git-Bash
When you install Git-Bash, you also install OpenSSH
suit.
Download Git for Windows
: git-scm.com: Win
If you change the default Git-Bash
location, for example, to the F:\Program Files\Git
folder, after a while you might get messages:
git not installed...
or
add to PATH
If so, you need to add F:\Program Files\Git\cmd
to your Path
environment variable.
SSH
For security reasons, you need to create another key pair, regarless of their presence, for each new connection.
Generate new ssh keys:
ssh-keygen -t rsa -f ~/.ssh/id_rsa_your_new_connection -b 4096 -C "your_email@example.com"
When prompt "Enter a file..."
press Enter.
When prompt "Enter passphrase..."
press Enter.
Starting ssh-agent:
eval $(ssh-agent -s)
Adding ssh-key to ssh-agent:
ssh-add ~/.ssh/id_rsa_your_new_connection
Connect to GitHub
Open ssh pub-key:
cat ~/.ssh/id_rsa.pub
Copy/past the above output into your GitHub account settings (new SSH key).
Read more: docs.github.com: Adding a new SSH key to your GitHub account
Git author identity
to set your account's default identity, run:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Check Connection
Source: docs.github.com: Testing Your SSH Connection
After saving the new SSH key to GitHub, open Git-Bash and run the command:
ssh -T git@github.com
You may see a warning like this:
> The authenticity of host 'github.com (IP ADDRESS)' can't be established.
> RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
> Are you sure you want to continue connecting (yes/no)?
Enter Yes
and then run git push
from any folder connected to GitHub.
You will see a GitHub checkout popup.
Choose the second method using code
and copy/past the suggested code into the provided link.