git + gh setup

Mar 28, 2026

-things I often forget

Check & Install gh

gh --version
sudo apt update
sudo apt install gh

Login

gh auth login
# Choose: GitHub.com → HTTPS → browser
gh auth status

SSH Key Setup

ssh-keygen -t ed25519 -C "your_email@example.com"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
# Copy output → GitHub → Settings → SSH keys

Test SSH

ssh -T git@github.com
# Expected: Hi username! You've successfully authenticated...

Create Repo

gh repo create my-project --public --source=. --remote=origin --push

First Push

git init
git add .
git commit -m "first commit"
git push -u origin main

Daily Workflow

git status
git add file.py
git commit -m "message"
git push
git pull

Branching

git checkout -b feature-x   # create & switch
git checkout main            # go back to main
git merge feature-x          # merge branch

Delete Branch

git branch -d feature-x                  # local
git push origin --delete feature-x       # remote
gh repo delete username/repo             # delete whole repo

Lost? Start Here

git status

go back to tech