https://github.com/petems/gitsweeper
A CLI tool for cleaning up git repos
https://github.com/petems/gitsweeper
Last synced: 5 months ago
JSON representation
A CLI tool for cleaning up git repos
- Host: GitHub
- URL: https://github.com/petems/gitsweeper
- Owner: petems
- Created: 2019-02-03T09:30:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-11T23:52:02.000Z (7 months ago)
- Last Synced: 2024-12-20T07:31:30.111Z (7 months ago)
- Language: Go
- Homepage:
- Size: 4.59 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `gitsweeper`
A CLI tool for cleaning up git repositories.
## Usage
### List branches merged into master
```bash
$ gitsweeper preview
Fetching from the remote...These branches have been merged into master:
origin/merged_already_to_masterTo delete them, run again with `gitsweeper cleanup`
```### Cleanup branches merged into master
```bash
$ gitsweeper cleanup
Fetching from the remote...These branches have been merged into master:
origin/merged_already_to_master
```## Installation
```bash
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](b.com/arc90/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](https://github.com/arc90/git-sweep/commit/d7522b4de1dbc85570ec36b82bc155a4fa371b5e), seems to be [broken with Python 3](https://github.com/arc90/git-sweep/issues/44).
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.