OneLinersCommand workbench
Cheatsheets

Incident guide · Git & CI/CD

Git recovery and CI/CD inspection cheat sheet

Understand repository state, changes, worktrees, reflog history, objects, and infrastructure configuration before modifying anything.
50explained commands2practical sections100%concrete examples
21

Git state and recovery evidence

Capture branch, diff, worktree, reflog, object, and cleanup previews.

Show concise branch and working-tree statusgit status --short --branchRead-only
Summarize changed files and line counts in Gitgit diff --statRead-only
List Git worktrees with branch detailsgit worktree list --porcelainRead-only
Show recent Git reference movementsgit reflog --date=iso -15Read-only
Summarize Git object database sizegit count-objects -vHRead-only
Preview untracked files Git would removegit clean -ndRead-only
Print the latest Git commit in one compact linegit log -1 --onelineRead-only
Draw a compact graph of all Git branchesgit log --oneline --graph --decorate --allRead-only
List branches ordered by their latest commitgit branch --sort=-committerdateRead-only
Discard uncommitted changes in one filegit restore <file>danger
List branches already merged into the current branchgit branch --mergedRead-only
Show Git remotes and their URLsgit remote -vRead-only
List saved Git stashesgit stash listRead-only
Rank repository contributors by commit countgit shortlog -sne --all | sort -nr | head -<count>Read-only
Rank files by how often they changed in Git historygit log --pretty=format: --name-only --diff-filter=ACMRT | sed '/^$/d' | sort | uniq -c | sort -nr | head -<count>Read-only
Search every Git revision for a text patterngit grep -n <pattern> $(git rev-list --all)Read-only
Build compact release notes between two Git tagsgit log <from-tag>..<to-tag> --no-merges --pretty=format:'- %s (%h, %an)'Read-only
Show local commits that have not reached the upstream branchgit log --oneline --decorate @{upstream}..HEADRead-only
Find the largest objects stored in a Git repositorygit verify-pack -v .git/objects/pack/*.idx | sort -k3 -nr | head -<count> | while read object type size rest; do echo "$size $object $(git rev-list --objects --all | rg "^$object ")"; doneRead-only
List unique contributors between two release tagsgit log <from-tag>..<to-tag> --format='%aN <%aE>' | sort -fuRead-only
List recent failed GitHub Actions runs with URLsgh run list --status failure --limit <count> --json workflowName,headBranch,conclusion,createdAt,url --jq '.[] | [.createdAt,.workflowName,.headBranch,.conclusion,.url] | @tsv'Read-only
29

Delivery configuration

Validate infrastructure and automation inputs without applying them.

Validate Terraform configuration filesterraform validateRead-only
Show Terraform provider requirementsterraform providersRead-only
Render the resolved Ansible inventory graphansible-inventory -i <inventory> --graphRead-only
Check an Ansible playbook's syntaxansible-playbook -i <inventory> playbook.yml --syntax-checkRead-only
Render a Helm chart locally for inspectionhelm template <release> ./chart -n <namespace> | head -40Read-only
Show running Docker containersdocker psRead-only
Follow the last 100 log lines from a containerdocker logs -f --tail 100 <container>Read-only
Show Docker disk usagedocker system dfRead-only
Start a Compose stack in the backgrounddocker compose up -dcaution
Take a one-shot container resource snapshotdocker stats --no-streamRead-only
List local Docker imagesdocker image lsRead-only
Inspect a container as structured JSONdocker inspect <container>Read-only
Open an interactive shell in a running containerdocker exec -it <container> /bin/shcaution
Follow logs from a Compose servicedocker compose logs -f --tail 100 <service>Read-only
Remove unused dangling Docker imagesdocker image prunedanger
List unhealthy Docker containers with their health outputdocker ps --filter health=unhealthy --format '{{.ID}}\t{{.Names}}\t{{.Status}}'Read-only
Map every container to its bind mounts and volumesdocker ps -aq | xargs docker inspect --format '{{.Name}}{{range .Mounts}}\t{{.Type}}:{{.Source}} -> {{.Destination}}<end>'Read-only
Print a container environment in deterministic orderdocker inspect --format '{{range .Config.Env}}{{println .}}<end>' <container> | sortRead-only
Show container names and addresses on a Docker networkdocker network inspect <network> --format '{{range $id, $c := .Containers}}{{$c.Name}}\t{{$c.IPv4Address}}\t{{$c.MacAddress}}<println><end>'Read-only
Inspect Docker image layers with full commands and sizesdocker history --no-trunc --format '{{.Size}}\t{{.CreatedBy}}' <image>Read-only
Extract recent error-level lines from a containerdocker logs --since <minutes>m --timestamps <container> 2>&1 | rg -i 'error|fatal|panic|exception' | tail -<count>Read-only
Render and validate the resolved Docker Compose configurationdocker compose -f <file> config --quiet && docker compose -f <file> configRead-only
Create a compressed backup of a Docker volumedocker run --rm -v <volume>:/source:ro -v <destination>:/backup alpine tar -czf /backup/<archive-file> -C /source .caution
Print a sortable one-shot Docker resource tabledocker stats --no-stream --format '{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}' | sort -k2 -hrRead-only
Inventory repository tags, IDs, sizes, and immutable digestsdocker image ls --digests --format '{{.Repository}}:{{.Tag}}\t{{.ID}}\t{{.Size}}\t{{.Digest}}'Read-only
Rank Kubernetes pods by total container restart countkubectl get pods -A -o json | jq -r '.items[] | [.metadata.namespace,.metadata.name,([.status.containerStatuses[]?.restartCount] | add // 0)] | @tsv' | sort -k3,3nr | head -<count>Read-only
Rank Kubernetes pods by memory consumptionkubectl top pods -A --no-headers | sort -k4 -hr | head -<count>Read-only
Show recent Kubernetes warning events in chronological orderkubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp -o custom-columns='TIME:.lastTimestamp,NAMESPACE:.metadata.namespace,REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message'Read-only
Inventory every Kubernetes deployment and container imagekubectl get deployments -A -o json | jq -r '.items[] | .metadata as $m | .spec.template.spec.containers[] | [$m.namespace,$m.name,.name,.image] | @tsv' | sortRead-only