commit/branch/workdir explorer for git

Overview

gitin

gitin is a commit/branch/status explorer for git

gitin is a minimalist tool that lets you explore a git repository from the command line. You can search from commits, inspect individual files and changes in the commits. It is an alternative and interactive way to explore the commit history. Also, you can explore your current state by investigating diffs, stage your changes and commit them.

screencast

Features

  • Fuzzy search (type / to start a search after running gitin <command>)
  • Interactive stage and see the diff of files (gitin status then press enter to see diff or space to stage)
  • Commit/amend changes (gitin status then press c to commit or m to amend)
  • Interactive hunk staging (gitin status then press p)
  • Explore branches with useful filter options (e.g. gitin branch press enter to checkout)
  • Convenient UX and minimalist design
  • See more options by running gitin --help, also you can get help for individual subcommands (e.g. gitin log --help)

Installation

  • Linux and macOS are supported, Windows is not at the moment.
  • Download latest release from here
  • Or, manually download it with go get -d github.com/isacikgoz/gitin/cmd/gitin
  • cd into $GOPATH/src/github.com/isacikgoz/gitin
  • build with make install (cmake and pkg-config are required, also note that git2go will be cloned and built)

Mac/Linux using brew

The tap is recently moved to new repo, so if you added the older one (isacikgoz/gitin), consider removing it and adding the new one.

brew tap isacikgoz/taps
brew install gitin

Usage

usage: gitin [<flags>] <command> [<args> ...]

Flags:
  -h, --help     Show context-sensitive help (also try --help-long and --help-man).
  -v, --version  Show application version.

Commands:
  help [<command>...]
    Show help.

  log
    Show commit logs.

  status
    Show working-tree status. Also stage and commit changes.

  branch
    Show list of branches.

Environment Variables:

  GITIN_LINESIZE=<int>
  GITIN_STARTINSEARCH=<bool
  GITIN_DISABLECOLOR=<bool>
  GITIN_VIMKEYS=<bool>

Press ? for controls while application is running.

Configure

  • To set the line size export GITIN_LINESIZE=5
  • To set always start in search mode GITIN_STARTINSEARCH=true
  • To disable colors GITIN_DISABLECOLOR=true
  • To disable h,j,k,l for nav GITIN_VIMKEYS=false

Development Requirements

  • Running with static linking is highly recommended.
  • Clone the project and cd into it.
  • Run make build-libgit2 (this will satisfy the replace rule in the go.mod file)
  • You can run the project with go run --tags static cmd/gitin/main.go --help command

Contribution

  • Contributions are welcome. If you like to please refer to Contribution Guidelines
  • Bug reports should include descriptive steps to reproduce so that maintainers can easily understand the actual problem
  • Feature requests are welcome, ask for anything that seems appropriate

Credits

See the credits page

License

BSD-3-Clause

Comments
  • Installer fails when trying to apply patch

    Installer fails when trying to apply patch

    [email protected]:~/gocode/src/github.com/isacikgoz/gitin $ make install
    git submodule -q foreach --recursive git reset -q --hard
    git submodule update --init --recursive
    if patch --dry-run -N -d /home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27 -p1 < git2go.v27.patch >/dev/null; then \
    		patch -d /home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27 -p1 < git2go.v27.patch; \
    	fi
    /bin/sh: git2go.v27.patch: No such file or directory
    make -C /home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27 install-static
    make[1]: Entering directory `/home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27'
    ./script/build-libgit2-static.sh
    + VENDORED_PATH=vendor/libgit2
    + cd vendor/libgit2
    + mkdir -p install/lib
    + mkdir -p build
    + cd build
    + cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../install ..
    CMake Error: The source directory "/home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27/vendor/libgit2" does not appear to contain CMakeLists.txt.
    Specify --help for usage, or press the help button on the CMake GUI.
    make[1]: *** [build-libgit2] Error 1
    make[1]: Leaving directory `/home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27'
    make: *** [build-libgit2] Error 2
    
    
    opened by ohle 10
  • Add support searching by commit id

    Add support searching by commit id

    It'd be really nice if I could just type in part of the commit hash (instead of commit message) and gitin log be able to find it. This is a simple task I perform daily and gitin does not seem to support it yet.

    Do you plan to add this kind of feature?

    Thanks and good job!

    feature request 
    opened by kmyokoyama 7
  • Index out of range

    Index out of range

    No results
    qpanic: runtime error: index out of range
    
    goroutine 243 [running]:
    github.com/isacikgoz/promptui/list.(*List).Index(0xc0000ac730, 0xc000000071)
    	/Users/ibrahim/go/src/github.com/isacikgoz/promptui/list/list.go:204 +0x67
    github.com/isacikgoz/promptui.(*Select).innerRun.func1(0xc01b3eefd8, 0x1, 0x1, 0x1, 0xc000000071, 0x)
    	/Users/ibrahim/go/src/github.com/isacikgoz/promptui/select.go:340 +0x9a3
    github.com/chzyer/readline.(*DumpListener).OnChange(0xc0000a2338, 0xc01b3eefd8, 0x1, 0x1, 0x1, 0x71,)
    	/Users/ibrahim/go/src/github.com/chzyer/readline/operation.go:516 +0x63
    github.com/chzyer/readline.(*Operation).ioloop(0xc02424b340)
    	/Users/ibrahim/go/src/github.com/chzyer/readline/operation.go:339 +0x397
    created by github.com/chzyer/readline.NewOperation
    	/Users/ibrahim/go/src/github.com/chzyer/readline/operation.go:88 +0x2b1
    
    can't reproduce 
    opened by Fuzion24 6
  • gitin_0.1.0_linux_amd64.tar.gz release isn't a self-contained static binary, has runtime dependency on libssl.so.1.1

    gitin_0.1.0_linux_amd64.tar.gz release isn't a self-contained static binary, has runtime dependency on libssl.so.1.1

    the linux release gitin_0.1.0_linux_amd64.tar.gz is not self-contained, has runtime dependencies on dynamic libraries (e.g. libssl.so.1.1 )

    steps to reproduce

    1. obtain a standard test environment without dev dependencies, e.g. a debian jessie slim container

    2. download binary release https://github.com/isacikgoz/gitin/releases/download/v0.1.0/gitin_0.1.0_linux_amd64.tar.gz

    3. untar the gitin

    4. add the gitin to the PATH

    5. run gitin --version

    expected behaviour

    gitin exits successfully after displaying version number

    observed behaviour

    gitin: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
    

    dockerfile to reproduce

    docker build -t gitin_static:dev -f test.Dockerfile .

    where test.Dockerfile contains

    FROM debian:jessie-20190122-slim
    
    RUN apt update
    RUN apt install -y wget
    
    WORKDIR /tmp
    RUN wget --quiet https://github.com/isacikgoz/gitin/releases/download/v0.1.0/gitin_0.1.0_linux_amd64.tar.gz
    RUN tar -xvzf gitin_0.1.0_linux_amd64.tar.gz
    RUN mkdir -p /tmp/bin
    RUN mv gitin /tmp/bin/gitin
    ENV PATH="$PATH":/tmp/bin/
    
    RUN gitin --version
    

    proposed cause

    git2go links to libgit2, which in turn links to various dependencies for ssh support, http support, etc. it seems like these latter dependencies tend to be linked dynamically, even if you use the scripts and documentation provided by git2go to do a "static" build of git2go.

    suggested fix

    if the gitin application does not actually require ssh or http support, you can customise build flags of libgit2 when compiling git2go to disable linking to these unnecessary dependencies.

    libgit2 build flags that can be customised are here: https://github.com/libgit2/libgit2/blob/master/CMakeLists.txt#L58

    i suggest disabling USE_SSH, USE_HTTPS, and USE_EXT_HTTP_PARSER (these are all educated guesses based on the option name)

    one way to do this is by modifying: https://github.com/libgit2/git2go/blob/master/script/build-libgit2-static.sh

    pass these additional flags to cmake: -DUSE_SSH=OFF -DUSE_HTTPS=OFF -DUSE_EXT_HTTP_PARSER=OFF after the -DBUILD_SHARED_LIBS=OFF flag.

    then, to build git2go run this modified script/build-libgit2-static.sh .

    the gitin application should still link against this new static git2go library if built using --tags static (as it looks like it is currently built)

    (this fix may not be 100% accurate, it's from memory -- i spent a few hours earlier today trying to figure how to do self-contained static builds for my own application that depends on git2go)

    enhancement 
    opened by fcostin 5
  • Dies pretty quickly in some project directories

    Dies pretty quickly in some project directories

    I'm on a Macbook Pro, Mojave, 10.14.2 (18C54).

    In some git projects, running gitin log, or even git -h, results in an error

    could not find repository from '/Users/myusername/Projects/myproject'

    Any other git tool (like tig) works fine. It's not all projects, just some, which is odd.

    I've narrowed it down to line 61, in gopkg.in/libgit2/git2go.v27/repository.go, which is this call into C code

    ret := C.git_repository_open(&ptr, cpath)
    

    This happened with both the release download, and with a version I built following the build instructions.

    If I can provide any more info, please let me know.

    question 
    opened by joeygibson 5
  • [Feature Request] - Flag to list branches by date

    [Feature Request] - Flag to list branches by date

    From the looks of it, it appears that the branches are organized alphabetically. It would be great to add a flag to sort them with latest at the top of the list.

    Also since it shows remote branches as well, having another flag to show only local branches would be nice.

    Great tool!

    feature request 
    opened by mikeymurph77 4
  • Show Author and Tags in `gitin log`

    Show Author and Tags in `gitin log`

    Hi, I really like gitin and I consider it as a replacement for tig. However, tig shows also the commit author and the tags in the commit overview. Especially the tags are very important to quickly see which commits made it into a release.

    Keep on rocking with gitin!

    feature request 
    opened by phauer 4
  • interactive hunk staging

    interactive hunk staging

    The one feature that still makes tig essential for me is interactive hunk staging, i.e. staging hunks from the diff view.

    In tig, one can even stage (or un-stage) single lines.

    feature request 
    opened by ohle 4
  • Error sounds play when exploring `gitin log`

    Error sounds play when exploring `gitin log`

    Using iTerm, and installed via brew

    I went straight into a repo and ran gitin log and used the arrow keys to explore. Interaction proceeded as expected, but every arrow key press triggered a sound from MacOS for an invalid interaction in the terminal.

    opened by Soben 4
  • [Feature Request] Keep search results when back to commit list

    [Feature Request] Keep search results when back to commit list

    It would be cool if it's possible to keep search results when back to commits list. For ex:

    gitin log -> type "/" -> type "add" -> arrow up/down -> enter 1 commit -> type "q" back to commits list

    In this case, it shows the original commits list without applying search "add".

    It would be cool to have the possibility to go back to the list with applying search "add". Maybe a hotkey "backspace" to go back to the filtered list?

    feature request 
    opened by KevCui 3
  • Error installing

    Error installing

    Run through the steps until this step:

    $ make install
    git submodule -q foreach --recursive git reset -q --hard
    git submodule update --init --recursive
    if patch --dry-run -N -d /home/ant/go/src/gopkg.in/libgit2/git2go.v27 -p1 < patch/git2go.v27.patch >/dev/null; then \
            patch -d /home/ant/go/src/gopkg.in/libgit2/git2go.v27 -p1 < patch/git2go.v27.patch; \
    fi
    patching file script/build-libgit2-static.sh
    make -C /home/ant/go/src/gopkg.in/libgit2/git2go.v27 install-static
    make[1]: Entering directory '/home/ant/go/src/gopkg.in/libgit2/git2go.v27'
    ./script/build-libgit2-static.sh
    + VENDORED_PATH=vendor/libgit2
    + cd vendor/libgit2
    + mkdir -p install/lib
    + mkdir -p build
    + cd build
    + cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../install -DUSE_EXT_HTTP_PARSER=OFF -DUSE_HTTPS=OFF -DUSE_NSEC=OFF -DUSE_SSH=OFF -DCURL=OFF -DUSE_GSSAPI=OFF -DUSE_BUNDLED_ZLIB=ON ..
    ./script/build-libgit2-static.sh: 11: ./script/build-libgit2-static.sh: cmake: not found
    Makefile:11: recipe for target 'build-libgit2' failed
    make[1]: *** [build-libgit2] Error 127
    make[1]: Leaving directory '/home/ant/go/src/gopkg.in/libgit2/git2go.v27'
    Makefile:34: recipe for target 'build-libgit2' failed
    make: *** [build-libgit2] Error 2
    
    question 
    opened by anthonydillon 3
  • improve search performance

    improve search performance

    • Asynchronously load items
    • Add search results to a buffer, regularly dump results into the list.scope
    • Fires an update to let prompt re-renders itself
    opened by isacikgoz 0
  • feat(status): Remove untracked file on discard

    feat(status): Remove untracked file on discard

    Something I have wanted to use in the past is the ! command on untracked files.

    Using git clean -f makes it possible to remove untracked files in a repository, so I implemented it on the ! command.

    Feedback welcome!

    opened by reobin 0
  • feat(log): Add key shortcut to copy commit hash

    feat(log): Add key shortcut to copy commit hash

    Something like y or c would be super useful to quickly copy the commit hash when using gitin log

    I'm willing to work on this when I have some free time. In the meantime, if anyone wants to have a go at it, it's super appreciated too.

    feature request 
    opened by reobin 1
  • Unable to install from AUR of Manjaro

    Unable to install from AUR of Manjaro

    When I tried to install gitin from AUR of Manjaro, there is error:

    $ pacui i gitin
    ==> Error: Could not find all required packages:
        libgit2=1:0.27.8 (Wanted by: gitin)
        libgit2-glib=0.27.8 (Wanted by: gitin)
    

    https://aur.archlinux.org/packages/gitin page says I have to downgrade my libgit2 to 0.27.8, but my current installed version is libgit2=1:1.0.0-1

    There was another issue mentioning this libgit2 problem, like https://github.com/isacikgoz/gitin/issues/57 , does gitin really have to use exactly libgit2=1:0.27.8 and libgit2-glib=0.27.8?

    opened by c02y 1
  • Issues with installing gitin

    Issues with installing gitin

    When installing, it errors out:

    ~ > go get -u github.com/isacikgoz/gitin
    # github.com/libgit2/git2go
    go/src/github.com/libgit2/git2go/git_dynamic.go:10:3: error: #error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
       10 | # error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
          |   ^~~~~
    
    enhancement 
    opened by thecsw 9
Releases(v0.2.5)
Owner
Ibrahim Serdar Acikgoz
Ibrahim Serdar Acikgoz
A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem

COMMIT CLI A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem. And yes, it is bui

Hisam Fahri 1 Feb 9, 2022
The missing git branch --interactive

git branch-i I got cross that there's no git branch --interactive, so I made this. It's a very (very) simple curses-mode git branch/git checkout alter

Joel Auterson 4 Nov 2, 2022
Branch is a small CLI tool to automatically create git branches based on tickets

________ ________ ________ ________ ________ ___ ___ |\ __ \ |\ __ \ |\ __ \ |\ ___ \ |\ ___

Maikel Veen 5 Nov 15, 2022
1Pass - 1Password Linux CLI explorer

1Pass is a command line application that allows to explore 1Password OPVault format. Application was created because there is no official 1Password desktop client for Linux users.

Maciej Bedra 8 Nov 14, 2022
🏗️ Fetch a specific commit without any history (shallow depth w/o cloning)

shallow-fetch-sha ??️ For a given git repository and commit, fetch and checkout just that commit without any history. This can be extremely useful in

Rob Herley 0 Nov 27, 2021
git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt.

Git GoGlimpse git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt. The particularity of this

Corentin de Boisset 0 Jan 27, 2022
Simple, seamless, lightweight time tracking for Git

Git Time Metric Seamless time tracking for all your Git projects $ gtm report -last-month $ gtm report -last-month -format summary $ gtm report -last-

Git Time Metric 917 Dec 1, 2022
Modern ls command with vscode like File Icon and Git Integrations. Written in Golang

logo-ls modern ls command with beautiful Icons and Git Integrations . Written in Golang Command and Arguments supported are listed in HELP.md Table of

Yash Handa 942 Dec 7, 2022
A tiny git forge written in Go

Smithy smithy (n) A blacksmith's shop; a forge. Smithy is a web frontend for git repositories. It's implemented entirely in Golang, compiles to a sing

Honza Pokorny 203 Sep 10, 2022
💊 A git query language

Gitql Gitql is a Git query language. In a repository path... See more here Reading the code ⚠️ This project was created in 2014 as my first go project

Claudson Oliveira 6k Dec 4, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Gruntwork 690 Nov 30, 2022
A better way to clone, organize and manage multiple git repositories

git-get git-get is a better way to clone, organize and manage multiple git repositories. git-get Description Installation macOS Linux Windows Usage gi

Greg Dlugoszewski 64 Nov 16, 2022
Bit is a modern Git CLI

bit is an experimental modernized git CLI built on top of git that provides happy defaults and other niceties: command and flag suggestions to help yo

Chris Walz 5.9k Dec 4, 2022
Interactive CLI helper for creating git branches with JIRA Links and some text

bb (better-branch) Interactive CLI helper for creating git branches with JIRA Links and some text Still in development? Yes How it works? This tiny ut

Eugene Uvarov 3 Aug 18, 2022
A command line http test tool. Maintain the case via git and pure text

httptest A command line http test tool Maintain the api test cases via git and pure text We want to test the APIs via http requests and assert the res

wklken 12 Aug 4, 2022
Contextual information about your git projects, right on the command-line

gitty gitty is a smart little CLI helper for git projects, that shows you all the relevant issues, pull requests and changes at a quick glance. It cur

Christian Muehlhaeuser 405 Nov 24, 2022
Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊

askgit is a command-line tool for running SQL queries on git repositories. It's meant for ad-hoc querying of git repositories on disk through a common interface (SQL), as an alternative to patching together various shell commands.

AskGit 3.2k Nov 26, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Maxar Infrastructure 1 Feb 5, 2022
A dead simple cli utility to help you manage your git stash

A dead simple cli utility to help you manage your git stash.

Fadi Khadra 3 Aug 2, 2022