RadarTrek

Quick Reference

Git & GitHub Cheat Sheet

Every command from the course, organised by category. Print it, save it, reference it.

Starting out

git initStart tracking a folder with Git
git clone <url>Copy a remote repo to your computer
git statusSee what has changed

Saving work

git add .Stage all changes
git add <file>Stage a specific file
git add -pStage changes interactively (line by line)
git commit -m "message"Save staged changes as a snapshot
git log --onelineSee commit history (compact)

GitHub (remote)

git remote add origin <url>Connect local repo to GitHub
git pushUpload commits to GitHub
git push -u origin mainFirst push — sets default remote
git pullDownload + merge changes from GitHub
git fetchDownload without merging

Branches

git switch -c <name>Create and switch to a new branch
git switch mainGo back to main branch
git branchList all branches
git merge <branch>Merge a branch into current
git branch -d <branch>Delete a branch (after merging)
git push origin <branch>Push a branch to GitHub

Undoing things

git restore <file>Discard unstaged changes to a file
git restore .Discard ALL unstaged changes
git restore --staged <file>Unstage a file (keep changes)
git reset HEAD~1Undo last commit, keep changes unstaged
git reset --soft HEAD~1Undo last commit, keep changes staged
git revert <hash>Safely undo a pushed commit
git stashTemporarily save uncommitted changes
git stash popRestore stashed changes

Inspecting

git diffSee unstaged changes
git diff --stagedSee staged changes
git log --oneline --graphVisual branch history
git show <hash>See what a commit changed
git blame <file>See who changed each line

Tags & releases

git tag -a v1.0.0 -m "msg"Create an annotated tag
git push origin --tagsPush all tags to GitHub
git tagList all tags

Forks & open source

git remote add upstream <url>Add the original repo as upstream
git fetch upstreamGet latest changes from upstream
git merge upstream/mainMerge upstream changes into your branch

Conventional commit prefixes

feat:New feature
fix:Bug fix
docs:Documentation only
chore:Maintenance, dependency updates
refactor:Code change that isn't a feature or fix
test:Adding or fixing tests
style:Formatting changes (no logic)

.gitignore essentials

node_modules/.env.env.localdist/.next/out/.DS_Store.cursor/*.log

RadarTrek Intel — monthly score updates

We track 40+ tools so you don't have to. Score changes, new tools, and new guides — once a month, no spam.