Skip to content

Instantly share code, notes, and snippets.

@apsrcreatix
Created June 4, 2025 12:40
Show Gist options
  • Save apsrcreatix/1dbfab2ea46f0045f06288e7ff64e521 to your computer and use it in GitHub Desktop.
Save apsrcreatix/1dbfab2ea46f0045f06288e7ff64e521 to your computer and use it in GitHub Desktop.
Github ssh setup before getting started!

Setting Up SSH for GitHub on macOS

1. Check for Existing SSH Directory

ls -al ~/.ssh

2. Generate a New SSH Key

Replace the email with your GitHub email address:

ssh-keygen -t ed25519 -C "[email protected]"

Follow the prompts to save the key (default path is recommended: ~/.ssh/id_ed25519).

3. Ensure the SSH Agent is Running

eval "$(ssh-agent -s)"

4. Configure SSH

Open the SSH Config File (if it exists)

open ~/.ssh/config

Or Create the Config File

touch ~/.ssh/config

Add the Following Configuration

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

5. Add Your SSH Key to the macOS Keychain

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

6. Add Your SSH Public Key to GitHub

Copy the contents of your public key (~/.ssh/your_ssh_private_key_name.pub) and add it to your GitHub SSH keys settings.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment