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 "[email protected]"
- 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 [email protected]
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
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 [email protected]:your-username/my-repo.git
git branch -M main
git push -u origin main
- Click Code → SSH and copy it
git clone [email protected]:your-username/my-repo.git
✅ Done! You’re all set to use Git and GitHub with SSH.