Git, Docker & kubectl Cheatsheets.
Searchable cheatsheet of everyday git, docker, docker compose and kubectl commands with short explanations.
Runs in your browserAbout Git, Docker & kubectl Cheatsheets
Git, Docker & kubectl Cheatsheets collects the commands developers reach for every week and makes them searchable by task instead of by name. Choose a tool or keep all three, then type what you want to do: "undo" shows git reset --soft, git revert, git restore and git reflog side by side; "logs" finds docker logs -f, docker compose logs and kubectl logs --previous; "rollback" shows kubectl rollout undo. Each row has the topic, the command with placeholders in angle brackets and a one-line explanation of what it does and when it is dangerous. The git section covers setup, staging hunks, branching, rebasing, remotes, stashing, tags, bisect and worktrees. The docker section covers images, containers, docker compose, volumes, networks and cleanup. The kubectl section covers contexts and namespaces, inspecting resources and events, logs and exec, port forwarding, ephemeral debug containers, rollouts, scaling, secrets and node maintenance. Common mistakes it helps prevent: force-pushing with --force instead of --force-with-lease, running git reset --hard with uncommitted work you still need, running docker compose down -v when the volumes hold data you want to keep (-v deletes them), reading a crashed pod's logs without --previous, and running kubectl against the wrong context. Replace the angle-bracket placeholders with your own names before running a command.
How to Use
- Pick git, docker, kubectl or all.
- Type a task or keyword such as undo, logs or scale.
- Copy the command and replace the <placeholders>.
Frequently Asked Questions
Which versions do the commands target?
Current releases: git 2.23+ (git switch and git restore), Docker with the compose plugin (docker compose, not docker-compose) and kubectl 1.25+ (kubectl debug).
Is git switch the same as git checkout?
For branches, yes. git switch and git restore split the two jobs of git checkout (changing branches and restoring files) into clearer commands; checkout still works.
What is the safest way to force-push?
git push --force-with-lease. It refuses to overwrite the remote branch if someone pushed commits you have not fetched yet.
Does this page send anything to a server?
No. The cheatsheet is bundled with the page and searching runs in your browser.
Related Tools
Combine .gitignore templates for languages, frameworks, editors and operating systems into one file.
Linux signal numbers with default actions, plus shell and sysexits exit codes such as 126, 127, 137 and 143.
Test regular expressions with match highlighting.
Build a Conventional Commits message with scope, body, breaking change and footers, plus the git command.
Convert Kubernetes CPU and memory quantities (500m, 512Mi, 1G) and total them across replicas.
Reference for all HTTP status codes.