Categorygithub.com/petems/gitsweeper
modulepackage
0.0.0-20240429144733-02039ce4a8b7
Repository: https://github.com/petems/gitsweeper.git
Documentation: pkg.go.dev

# README

gitsweeper

A CLI tool for cleaning up git repositories.

Usage

List branches merged into master

$ gitsweeper preview
Fetching from the remote...

These branches have been merged into master:
  origin/merged_already_to_master

To delete them, run again with `gitsweeper cleanup`

Cleanup branches merged into master

$ gitsweeper cleanup
Fetching from the remote...

These branches have been merged into master:
  origin/merged_already_to_master

Installation

go install github.com/petems/gitsweeper@latest

Eventually I'll configure Travis to build binaries and setup a brew tap for OSX and Linux.

Background

gitsweeper is a tribute to a tool I've been using for a long time, git-sweep. git-sweep is a great tool written in Python.

However, since then it seems to have been abandoned. It's not had a commit pushed since 2016, seems to be broken with Python 3.

I've been trying to learn more Go recently, and Go has some excellent CLI library tools as well as the ability to build a self-contained binary for distribution, rather than having to make sure it works with various versions of go etc.

gitsweeper matches the output matches the original tool quite a lot:

$ git-sweep preview
Fetching from the remote
These branches have been merged into master:

  merged_already_to_master

To delete them, run again with `git-sweep cleanup`

but has a few changes that are tweaked toward my requirements.

# Constants

Version is what is returned by the `-v` flag.