Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mykolaharmash/git-jump

Improved navigation between Git branches.
https://github.com/mykolaharmash/git-jump

branches cli cli-ui fuzzy-search git

Last synced: about 2 months ago
JSON representation

Improved navigation between Git branches.

Awesome Lists containing this project

README

        

![git-jump CLI logo](https://raw.githubusercontent.com/mykolaharmash/git-jump/main/img/readme-banner.png)

# Git Branches Helper

* Interactive UI to view and switch branches
* Sorting by recently used
* Fuzzy search
* Fuzzy switch: `git jump hlw` → `git switch hello-world`
* Uses native `git switch` under the hood, supports all its parameters

Give it a ⭐️ if you like it. This really helps.


git jump interactive interface

## Install

```shell
npm install -g git-jump
```
or using Homebrew
```shell
brew tap mykolaharmash/git-jump
brew install git-jump
```

## Usage

```shell
git jump
```
Run without arguments to launch the interactive UI.

* At first, branches are not sorted. Once you start switching around, `git jump` will track the history and sort the list, so that the most recently used branches are at the top and can be accessed faster.
* Navigate the list with ↓↑ arrows and hit enter ⏎ to switch into selected branch.
* On the left hand side of the list you'll see a number next to a brunch name. Use Option+\ for quick switch (Alt+\ on Windows and Linux).
* Start typing to filter the list. The search is fuzzy, you don't have to be precise.
* Ctrl+C to exit.


```shell
git jump
```
Switches to a branch. `` can be just part of the name, `git jump` will look for the best matching branch.


```shell
git jump [--list | -l]
```
Shows a plain list of branches without interactive UI but with sorting.


```shell
git jump
```

You can use `git jump` as a drop-in replacement for [native `git switch`](https://git-scm.com/docs/git-switch). `git jump` will proxy all the argument to the native command, so you don't have to think to use one or the other.

For example `git jump my-branch --discard-changes` works just fine.


```shell
git jump new
```
Creates a new branch and switches into it. Supports all native parameters of `git switch`, for example `git jump new --track origin/main`.


```shell
git jump rename
```
Renames a branch.


```shell
git jump delete [, ...]
```
Deletes one or multiple branches. No fuzzy matching here, of course 🙂.

## How To Enable Option/Alt+\ Shortcut

It might be disabled by default in your terminal, here is how to make it work in some apps.

### iTerm 2

In Preferences go to `Profiles`, select your profile and go to `Keys`. At the bottom set `Left Option (⌥) Key` to `Esc+`.

![iTerm 2 app preferences window](https://raw.githubusercontent.com/mykolaharmash/git-jump/main/img/[email protected])

### macOS Terminal

In Preferences go to `Profiles`, select your profile and go to `Keyboard`. Enable `Use Option as Meta key` checkbox.

![macOS Terminal app preferences window](https://raw.githubusercontent.com/mykolaharmash/git-jump/main/img/[email protected])

### Hyper

Open `.hyper.js` and add next line to the `config` section:

```js
modifierKeys: { altIsMeta: true }
```