Skip to content

Instantly share code, notes, and snippets.

@KristofferRisa
Created April 20, 2026 08:29
Show Gist options
  • Select an option

  • Save KristofferRisa/e46104c0d43cc0d2be9634c49aec46fb to your computer and use it in GitHub Desktop.

Select an option

Save KristofferRisa/e46104c0d43cc0d2be9634c49aec46fb to your computer and use it in GitHub Desktop.
Weekly Git Reset Audit

Scan all Git repositories in this folder and bring me up to date.

Phase 1: Inspect only

  • Report repo name, current branch, working tree status, uncommitted changes, local branches, tracking status, ahead/behind status, stale branches, and branches whose upstream no longer exists.
  • Fetch remotes safely and identify stale remote-tracking refs that can be pruned.
  • Do not modify anything yet.

Phase 2: Summarize

  • Summarize per repo:
    • uncommitted work needing a decision
    • safe cleanup candidates
    • recommended actions

Rules

  • Do not discard code, stash, reset, delete branches, or push without my approval.
  • Do not touch protected branches: main, master, develop, dev, release, production.
  • Never delete the current branch.

After I approve:

  • prune stale remote-tracking refs
  • delete only safe local branches that are already merged and no longer have an upstream
  • refresh main branches using fetch + fast-forward only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment