An open API service indexing awesome lists of open source software.

https://github.com/robinck/git-cleaner

:scissors: CLI utility for bulk cleanup of branches and tags πŸ‡ΊπŸ‡¦
https://github.com/robinck/git-cleaner

Last synced: over 1 year ago
JSON representation

:scissors: CLI utility for bulk cleanup of branches and tags πŸ‡ΊπŸ‡¦

Awesome Lists containing this project

README

          

# git-cleaner

![Build CI](https://github.com/RobinCK/git-cleaner/workflows/Build%20CI/badge.svg?branch=master)
[![Version](https://img.shields.io/npm/v/git-cleaner.svg?style=flat-square)](https://www.npmjs.com/package/git-cleaner)
[![License](https://img.shields.io/npm/l/git-cleaner.svg?style=flat-square)](https://github.com/RobinCK/git-cleaner/blob/master/LICENSE)

:scissors: CLI utility for bulk cleanup of branches and tags

## Why?

Sooner or later, a lot of unnecessary branches and tags can accumulate
in the project, but most UI utilities do not allow you to multi-select
elements for deletion, and this is exactly the task of this utility.

## Features

- multiselect branches/tags for removal
- multiple remote
- filtering on select mode
- displaying progress

## Install

#### NPM

```bash
npm install git-cleaner -g
```

#### Yarn

```bash
yarn global add git-cleaner
```

## Development Setup

```bash
# install dependencies
npm install

# build dist files
npm run build
```

## Note

Before using the utility you need to sync git

```bash
# Delete local tags
git tag -l | xargs git tag -d

# Fetch remote branches and tags
git fetch
```

## Usage

```bash
Usage: gitc [options] [command]

Options:
-v, --version output the version number
-h, --help display help for command

Commands:
tag|t clean tags
branch|b clean branches
help [command] display help for command
```

## Examples

#### Removing branches by regexp

```shell script
gitc branch feat
```

#### Removing selected branches

```shell script
gitc branch
```

#### Removing tags by regexp

```shell script
gitc tag 'v.*\.2\..*'
```

#### Removing selected tags

```shell script
gitc tag
```

MIT Β© [Igor Ognichenko](https://github.com/RobinCK)