Checking for existing SSH keys

ls -al ~/.ssh

Generate a new SSH key

Paste the text below, replacing the email used in the example with your GitHub email address.

ssh-keygen -t ed25519 -C "This email address is being protected from spambots. You need JavaScript enabled to view it."

The key is saved into the file id_ed25519

start the ssh-agent in the background

eval "$(ssh-agent -s)"

to automatically load the keys into ssh-agent

open ~/.ssh/config

Type in this

Host github.com AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_ed25519

Add your SSH private key to the ssh-agent and store your passphrase in the keychain. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_ed25519 in the command with the name of your private key file.

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

how to add key to GitHub

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

pbcopy < ~/.ssh/id_ed25519.pub

# Copies the contents of the id_ed25519.pub file to your clipboard

settings/SSH and GPG keys

Button: New SSH key

------

Make a SSH key

https://help.github.com/articles/generating-ssh-keys

 

Cloning Repositories

git clone ssh://<user>@<host>/path/to/repo.git

 

Setting up git

This creates a folder called ourfirstrepo and inits git.

 git init ourfirstrepo

 

(or 'git init' if you have the project already created)

 

git remote add origin This email address is being protected from spambots. You need JavaScript enabled to view it.:IvanGit2/barebones.git

 

Check the url

git config --get remote.origin.url

 

First push

git push origin master

 

After the first push

git push

git fetch

git diff mybranch origin/mybranch

git merge