🏠 Home / Hub
🔶 Git Lesson 04 — Remote & GitHub Setup
← Back to Git Menu | 🏠 Hub
1. Remote Repository
Remote = cloud ထဲမှာ ရှိတဲ့ repository copy
GitHub / GitLab / Bitbucket = popular remote hosts
"origin" = default remote name (convention)
# View remotes
git remote -v
# origin https://github.com/user/repo.git (fetch)
# origin https://github.com/user/repo.git (push)
# Add remote
git remote add origin https://github.com/user/myapp.git
# Change remote URL
git remote set-url origin https://github.com/user/new-repo.git
# Remove remote
git remote remove origin
2. Push & Pull
# First push — set upstream
git push -u origin main
# -u = --set-upstream (subsequent pushes: just "git push")
# Push feature branch
git push origin feature/login
# Pull (fetch + merge)
git pull origin main
# Fetch only (download but don't merge)
git fetch origin
git log origin/main --oneline # see remote commits
git diff HEAD origin/main # compare local vs remote
# Pull with rebase (cleaner history)
git pull --rebase origin main
# Set default pull strategy
git config --global pull.rebase false # merge (default)
git config --global pull.rebase true # rebase
# Delete remote branch
git push origin --delete feature/old-feature
3. GitHub SSH Setup (No password prompt)
# 1. Generate SSH key
ssh-keygen -t ed25519 -C "ko@example.com"
# Press Enter 3 times (default path, no passphrase)
# 2. View public key
cat ~/.ssh/id_ed25519.pub
# ssh-ed25519 AAAAC3Nza... ko@example.com
# 3. Add to GitHub
# github.com → Settings → SSH Keys → New SSH Key → paste key
# 4. Test connection
ssh -T git@github.com
# Hi ko-username! You've successfully authenticated.
# 5. Use SSH URL (not HTTPS)
git remote set-url origin git@github.com:username/repo.git
# Now push/pull without password!
git push origin main
💡 SSH = once setup → never type password again | HTTPS = need Personal Access Token (2021+)
4. Clone — Download Repository