---
title: "You know how every time you create a new repo on GitHub, you need to:"
date: 2026-05-29
canonical: https://solmaz.io/x/2060274502278554077/
x_url: https://x.com/onusoz/status/2060274502278554077
license: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
---

You know how every time you create a new repo on GitHub, you need to:

- create a branch protection rule on main, block force pushes
- enable auto-merge
- make branches delete when PR gets merged
- enforce linear history, disable merge commits
- enable update branch button

Now, you can do all that with a single command:

npx github-sane-defaults@latest plan <your-org-handle> --all

This is just the plan command, shows you which repos don't have branch protection rules and those settings, like:

changes awesomeorg/awesomerepo
  Settings
    allow_merge_commit          true -> false
    allow_auto_merge            false -> true
    allow_update_branch         false -> true
    delete_branch_on_merge      false -> true
  Ruleset   create

Then you run it with apply instead of plan, and it makes those changes

Basically a very simple github policy manager. Let me know if you want configurability with policy files, currently it just applied my opinionated defaults

Either way, this will never be something too deep, there is terraform for that

Source: https://github.com/dutifuldev/github-sane-defaults
