Crates.io | gitprompt-rs |
lib.rs | gitprompt-rs |
version | 0.3.0 |
source | src |
created_at | 2018-12-29 09:01:23.764621 |
updated_at | 2021-01-29 11:55:40.047902 |
description | A very simple Git prompt |
homepage | |
repository | https://github.com/Streetwalrus/gitprompt-rs |
max_upload_size | |
id | 104368 |
size | 24,229 |
A very simple Git prompt written in Rust
Just add $(gitprompt-rs)
to your shell prompt. Make sure you use single quotes
'
or escape the $
to prevent early expansion.
Zsh additionally requires setopt promptsubst
to make this work.
You most likely want to let your shell know that the color escape sequences are
not actually visible so it will calculate the length correctly. Pass bash
for
Bash or zsh
for Zsh.
The prompt looks like this: (master↑4↓7|+2~3-5x6•8)
. The information on
display is as follows:
master
: name of the current branch, :HEAD
in detached head mode↑
: number of commits ahead of remote↓
: number of commits behind remote+
: untracked (new) files~
: modified files-
: deleted filesx
: merge conflicts•
: staged changescargo install --path .
.cargo install gitprompt-rs
pacman -S gitprompt-rs