ls -al ~/.ssh
Replace the email with your GitHub email address:
ssh-keygen -t ed25519 -C "youremail@example.com"
Follow the prompts to save the key (default path is recommended: ~/.ssh/id_ed25519).
eval "$(ssh-agent -s)"
open ~/.ssh/config
touch ~/.ssh/config
Replace your_ssh_private_key_name with the actual filename (e.g., id_ed25519):
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/your_ssh_private_key_name
ssh-add --apple-use-keychain ~/.ssh/your_ssh_private_key_name
Copy the contents of your public key (~/.ssh/your_ssh_private_key_name.pub) and add it to your GitHub SSH keys settings.