# @jithyan/git-branch-manager

> Simple CLI to avoid typing out full git branch names for switching or deleting branches.

Latest version **3.0.3** (published 2023-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jithyan/git-branch-manager
pnpm add @jithyan/git-branch-manager
yarn add @jithyan/git-branch-manager
bun add @jithyan/git-branch-manager
```

Provides the command `gbm`.

## Health

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

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2023-11-10 |
| First published | 2023-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 16 |
| Dependencies | 0 |
| Unpacked size | 678.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | jithyan |
| Maintainers | jnan |
| Keywords | git, utility, branch, cli |

## Links

- npm: https://www.npmjs.com/package/@jithyan/git-branch-manager
- Repository: https://github.com/jithyan/git-branch-manager
- Homepage: https://github.com/jithyan/git-branch-manager#readme
- Issues: https://github.com/jithyan/git-branch-manager/issues
- npm.io page: https://npm.io/package/@jithyan/git-branch-manager

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2023-11-10
- 3.0.2 — 2023-11-09
- 3.0.1 — 2023-11-09
- 3.0.0 — 2023-11-09
- 2.0.1 — 2023-06-22
- 2.0.0 — 2023-06-22
- 1.3.0 — 2023-06-22

## README

# git-branch-manager

Simple CLI to conveniently switch, remove and checkout remote branches without having to type out full branch names.
It also has a few other shorthand commands that I find helpful.

As of v3, it is written in Rust.

## Get started

> This will only will work with Node 16 and above

```bash
npm install -g @jithyan/git-branch-manager
```

Now you can run it by calling `gbm`.

## How to use

1. `cd` into a `git` repo.
2. Run `gbm <command>`

## Available commands

### switch (sw)

Allows you to select a local branch to switch to. Equivalent to running `git checkout <selected_branch_name>`.

Example:

`gbm switch`

![switch example](./img/switch.png)

### remove (rm)

Allows you to select a branch that is checked out locally to remove. Equivalent to running `git branch -D <selected_branch_name>`.

Example:

`gbm remove`

![remove example](./img/remove.png)

### add

Allows you to filter branches from remote and select a branch to checkout locally. Equivalent to running `git fetch && git checkout <selected_branch_name>`.

Example:

`gbm add`

![add example](./img/add.png)

### rb <branch_name>

Equivalent to running `git fetch && git pull origin <branch_name> -r`

Example:

`gbm rb main`

![stash example](./img/rb.png)

### pff

Equivalent to running `git fetch && git pull --ff-only`

Example:

`gbm pff`

![stash example](./img/pff.png)

### ct <branch_name>

Transfer **all** changes in the current branch (tracked and untracked) to a new branch and commit it with the message "initial commit".

Equivalent to running:

```sh
git add .
git stash
git checkout -b <branch_name>
git stash pop
git add .
git commit -m "initial commit"
```

Example:

`gbm ct fix-bug`

![stash example](./img/ct.png)

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