DEV Community

SybilGambleyyu
SybilGambleyyu

Posted on • Originally published at sybilgambleyyu.github.io

gitstale: clean up abandoned local branches

Local clones accumulate feature branches. Some are long merged; some still diverge from main. git branch lists names, not age or merge status.

gitstale ranks local branches by tip age and shows whether each tip is already an ancestor of the base branch, plus ahead/behind counts.

Install

pip install git+https://github.com/SybilGambleyyu/gitstale.git
Enter fullscreen mode Exit fullscreen mode

Usage

gitstale --merged --days 14    # safe delete candidates
gitstale --unmerged --days 60  # long-lived open work
gitstale -f md
Enter fullscreen mode Exit fullscreen mode

Never deletes anything — report only. Zero dependencies. MIT.

Source: github.com/SybilGambleyyu/gitstale

Top comments (0)