#git #diff #cli-tool #terminal #cli

bin+lib git-hist

A CLI tool to quickly browse the git history of files on a terminal

8 releases (stable)

1.0.5 Jul 9, 2022
1.0.4 Aug 17, 2021
1.0.1 Apr 7, 2021
1.0.0 Mar 29, 2021
0.1.2 Mar 29, 2021

#2576 in Command line utilities

Download history 1/week @ 2024-02-20 5/week @ 2024-02-27 10/week @ 2024-03-26 61/week @ 2024-04-02

71 downloads per month

MIT license

195KB
1.5K SLoC

git-hist

crates.io license: MIT

A CLI tool to quickly browse the git history of files on a terminal. This project is inspired by git-history.

Installation

cargo install git-hist

Usage

git hist <file>

You can use git-hist as a git subcommand, so the hyphen is not required.

Keymap

  • Left / Right : Go to a previous/next commit.
  • Up / Down or mouse scrolls: Scroll up/down.
  • PageUp / PageDown : Scroll page up/down.
  • Home / End : Scroll to the top/bottom.
  • q, Ctrl+c, Ctrl+d : Exit.

Help

$ git-hist --help
git-hist {{ version }}
A CLI tool to quickly browse the git history of files on a terminal

USAGE:
    git-hist [OPTIONS] <file>

ARGS:
    <file>    Set a target file path

OPTIONS:
        --beyond-last-line        Set whether the view will scroll beyond the last line
        --date-format <format>    Set date format: ref. https://docs.rs/chrono/0.4.19/chrono/format/strftime/index.html [default: [%Y-%m-%d]]
        --date-of <user>          Use whether authors or committers for dates [default: author] [possible values: author, committer]
        --emphasize-diff          Set whether the view will emphasize different parts
        --full-hash               Show full commit hashes instead of abbreviated commit hashes
    -h, --help                    Print help information
        --name-of <user>          Use whether authors or committers for names [default: author] [possible values: author, committer]
        --tab-size <size>         Set the number of spaces for a tab character (\t) [default: 4]
    -v, --version                 Print version information

Dependencies

~19–35MB
~598K SLoC