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
Suppress commit to master and development, merge branch to master and development

git-extension masterと名前のつくブランチをマージするのは禁止 masterとdevelopmentブランチに直接commitやmergeするのは禁止 masterブランチを親に新規ブランチを作成するのは禁止 どうしてもmasterやdevelopmentブランチに操作をしたい時は

y-oga 1 Nov 8, 2021
A great util to format you git commit message!

A great util to format you git commit message!

常乐村喵蕉君 0 Dec 2, 2021
Go-commitlinter - simple commit message linter

go-commitlinter go-commitlinter is simple commit message linter. Quick Start go

Masahiro331 13 Aug 21, 2022
Git with a cup of tea, painless self-hosted git service

Gitea - Git with a cup of tea View the chinese version of this document Purpose The goal of this project is to make the easiest, fastest, and most pai

Gitea 32.5k Sep 29, 2022
ReGit: A Tiny Git-Compatible Git Implementation written in Golang

ReGit is a tiny Git implementation written in Golang. It uses the same underlying file formats as Git. Therefore, all the changes made by ReGit can be checked by Git.

null 166 Aug 30, 2022
A Git RPC service for handling all the git calls made by GitLab

Quick Links: Roadmap | Want to Contribute? | GitLab Gitaly Issues | GitLab Gitaly Merge Requests | Gitaly is a Git RPC service for handling all the gi

null 1 Nov 13, 2021
A simple cli tool for switching git user easily inspired by Git-User-Switch

gitsu A simple cli tool for switching git user easily inspired by Git-User-Switch Installation Binary releases are here. Homebrew brew install matsuyo

Masaya Watanabe 202 Sep 15, 2022
Removes unnecessarily saved git objects to optimize the size of the .git directory.

Git Repo Cleaner Optimizes the size of the .git directory by removing all of the files that are unnecessarily-still-saved as part of the git history.

Omar Yasser 2 Mar 24, 2022
Gum - Git User Manager (GUM) - Switch between git user profiles

Git User Manager (GUM) Add your profile info to config.yaml Build project: go bu

Mehmet Tevfik YÜKSEL 6 Feb 14, 2022
Git-now-playing - Git commits are the new AIM status messages

git-now-playing git-now-playing is an attempt to bring some of the panache of th

Paddy 1 Apr 4, 2022
Gogs is a painless self-hosted Git service

Gogs - A painless self-hosted Git service 简体中文 ?? Vision The Gogs (/gɑgz/) project aims to build a simple, stable and extensible self-hosted Git servi

Gogs 40.9k Sep 21, 2022
A highly extensible Git implementation in pure Go.

go-git is a highly extensible git implementation library written in pure Go. It can be used to manipulate git repositories at low level (plumbing) or

go-git 3.9k Sep 21, 2022
A command-line tool that makes git easier to use with GitHub.

hub is a command line tool that wraps git in order to extend it with extra features and commands that make working with GitHub easier. For an official

GitHub 22.1k Sep 28, 2022
A tool to monitor git repositories and automatically pull & push changes

git-o-matic A tool to monitor git repositories and automatically pull & push changes Installation Packages & Binaries Arch Linux: gitomatic Binaries f

Christian Muehlhaeuser 1k Sep 16, 2022
SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase

gitbase gitbase, is a SQL database interface to Git repositories. This project is now part of source{d} Community Edition, which provides the simplest

source{d} 2k Sep 16, 2022
Fast and powerful Git hooks manager for any type of projects.

Lefthook The fastest polyglot Git hooks manager out there Fast and powerful Git hooks manager for Node.js, Ruby or any other type of projects. Fast. I

Abroskin Alexander 2.4k Sep 25, 2022
Implementation of git internals from scratch in Go language

This project is part of a learning exercise to implement a subset of "git" commands. It can be used to create and maintain git objects, such as blobs, trees, commits, references and tags.

Shyamsunder Rathi 36 Aug 30, 2022
A Simple and Comprehensive Vulnerability Scanner for Container Images, Git Repositories and Filesystems. Suitable for CI

A Simple and Comprehensive Vulnerability Scanner for Containers and other Artifacts, Suitable for CI. Abstract Trivy (tri pronounced like trigger, vy

Aqua Security 14k Sep 25, 2022
go mod vendor lets you check in your dependencies to git, but that's both bloaty (for developers) and tedious (remembering to update it).

go-mod-archiver Afraid of being unable to build historical versions of your Go program? go mod vendor lets you check in your dependencies to git, but

Tailscale 83 Aug 28, 2022