# @duylam/git-gc

> A command line tool to clean up unused git branches

Latest version **1.0.5-beta.1** (published 2020-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @duylam/git-gc
pnpm add @duylam/git-gc
yarn add @duylam/git-gc
bun add @duylam/git-gc
```

Provides the command `git-gc`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5-beta.1 |
| Published | 2020-03-31 |
| First published | 2020-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 5 |
| Unpacked size | 248.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Duy Lam |
| Maintainers | duylam |
| Keywords | git, clean-up, tool |

## Links

- npm: https://www.npmjs.com/package/@duylam/git-gc
- Repository: https://github.com/duylam/git-gc
- Issues: https://github.com/duylam/git-gc/issues
- npm.io page: https://npm.io/package/@duylam/git-gc

## Dependencies (5)

- [async](https://npm.io/package/async.md) ^3.2.0
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [yargs](https://npm.io/package/yargs.md) ^15.0.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [bluebird](https://npm.io/package/bluebird.md) ^3.7.2

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.5-beta.1 (latest) — 2020-03-31
- 1.0.4 — 2020-03-29
- 1.0.3 — 2020-03-18
- 1.0.1 — 2020-03-18
- 1.0.0-beta.3 — 2020-03-18
- 1.0.0-beta.2 — 2020-03-15
- 1.0.0-beta.1 — 2020-03-15

## README

# git-gc

**`git-gc` was renamed to `git-branch-clean`. Please visit and use [git-branch-clean](https://www.npmjs.com/package/@duylam/git-branch-clean) package instead**

![npm](https://img.shields.io/npm/v/@duylam/git-gc)

A command line tool to clean up unused git branches

**Table of content**

<!-- toc -->

- [1. Usage](#1-usage)
- [2. Contribution](#2-contribution)
  * [2.1 Setup](#21-setup)
  * [2.2 Getting started](#22-getting-started)
  * [2.3 Other development commands](#23-other-development-commands)

<!-- tocstop -->

## 1. Usage

1. Install [nodejs](https://nodejs.org/en/download/). The minimum version supported is v8.x or newer
1. Install the command line tool

```bash
npm i -g @duylam/git-gc
```

3. `cd` to a git folder
1. To remove unused branches at
  - local branches
  ```bash
  git-gc
  ```
  - remote repo with name `origin`
  ```bash
  git-gc -r origin
  ```
5. Above command prints branches that will be removed, and asks for confirmation. Below is how it looks like

```bash
$ git-gc
Switching to branch 'master'
Following local branches will be deleted:
  sample-branch-1
  sample-branch-2
  sample-branch-3
Type 'y' to delete above branch or any key for canceling, then hit Enter: y
Finished!
```

6. Finished! Your git folder (or remote git repo) is clean now. See more options with `git-gc -h`

## 2. Contribution

### 2.1. Setup

- [NodeJs](https://nodejs.org/en/download/) v8.x

### 2.2. Getting started

1. Run `npm install` to install dependencies.
1. Run `npm start` to begin watching file changes and auto build to `build` folder.
1. Alter `$PATH` for launching `build/index.js`: `PATH=$PATH:/this-folder/build`
1. Move to another git folder (e.g `cd /some/git/folder`) and run the tool: `DEBUG=git-gc index.js --help`
1. Begin coding, Pull Requests are welcome :)

### 2.3. Other development commands

- `npm run format` to format the code nicer
- `npm run lint` to run static code checker
- `npm run update-toc` to update the Table of Content in this file
- To create dummy local and remote (name "origin") git branches for coding, run the script [./scripts/create-dummy-branches.sh](./scripts/create-dummy-branches.sh) at any git folder

---
_Source: https://npm.io/package/@duylam/git-gc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
