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.