This guide shows you how to:
- ✅ Set up SSH with GitHub
- ✍️ Set your Git name and email
- ⬆️ Upload (push) files to GitHub
- ⬇️ Download (clone) files from GitHub
ssh-keygen -t ed25519 -C "your_email@example.com"
- Press Enter to save in the default place
- Press Enter again when asked for passphrase (or type one to protect your key)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
- Copy the full key (starts with
ssh-ed25519
)
- Go to GitHub SSH settings
- Click New SSH key
- Paste your key and save it
ssh -T git@github.com
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
To check:
git config --global user.name
git config --global user.email
git config --global init.defaultBranch main
- Go to https://github.com/new
- Give it a name, uncheck README, and create it
mkdir my-repo
cd my-repo
git init
echo "Hello GitHub" > file.txt
git add file.txt
git commit -m "Initial commit"
git remote add origin git@github.com:your-username/my-repo.git
git branch -M main
git push -u origin main
- Click Code → SSH and copy it
git clone git@github.com:your-username/my-repo.git
✅ Done! You’re all set to use Git and GitHub with SSH.