lazy-git-checkout

Crates.iolazy-git-checkout
lib.rslazy-git-checkout
version0.1.3
sourcesrc
created_at2024-01-25 02:11:22.370968
updated_at2024-01-26 17:52:14.725653
descriptionChange branches while stashing and unstashing changes
homepagehttps://github.com/manuelpepe/lazy-git-checkout
repositoryhttps://github.com/manuelpepe/lazy-git-checkout
max_upload_size
id1113306
size53,825
Manuel Pepe (manuelpepe)

documentation

README

lazy-git-checkout

Small program for quickly switching between branches, stashing and unstaging your last changes.

Changing branches with lgc is similar to doing:

git stash -m $CUR_BRANCH
git checkout $NEXT_BRANCH
git stash pop $LAST_NEXT_BRANCH_STASH_REF

but with hopefully fewer keystrokes.

It also allows you to track your most used branches to avoid any git branch | grep ...

Installing

From crates.io:

cargo install lazy-git-checkout

From source:

git clone https://github.com/manuelpepe/lazy-git-checkout.git
cd lazy-git-checkout
cargo install --path .

Make sure to have cargo's bin directory in your PATH. Additionally alias for easier access:

alias lg=lazy-git-checkout

Usage

$ lazy-git-commit -A .  # add project in current directory
$ lazy-git-commit       # launch ui

Keybinds:

Key Mode: Checkout Mode: Search Mode: Add
ESC Set Mode: Checkout Set Mode: Checkout
Enter Checkout to branch Checkout to branch Add branch to lgc known branches
Backspace Delete char Delete char Delete char
ArrUp Move selection up Move selection up Move selection up
ArrDown Move selection down Move selection down Move selection down
Shift+ArrUp Swap selection up
Shift+ArrDown Swap selection down
q Exit app
a Set Mode: Add
? Set Mode: Search
r Remove branch from known branches
k Move selection up
j Move selection down
K Swap selection up
J Swap selection down
Commit count: 0

cargo fmt