5

I'm looking for a text-mode client for git – ideally something like Midnight Commander (so if there's some "Gitnight Commander", that's it).

Requirements

  • text-mode, so it also works over an SSH shell
  • runs on Linux (Debian)
  • offers an nCurses like text-GUI the user can navigate with the keyboard
  • shows (and lets navigate through) commit history, tree structure etc.
  • allows at least for basic actions like blame and diff
  • intuitive usage
  • free (as in "free beer" and in "free speech"; ­i.e. FOSS)

Strongly preferred

  • available via standard Debian repository
  • well maintained and up-to-date

I primarily need this to browse git repositories on a remote host, so "read-only" is perfectly fine. If it goes beyond that – well, cannot hurt as long it doesn't end with "bloated". Should be easy to use.

4

What comes very close to my needs is tig: a text-mode interface using ncurses.

tig tig
tig: browsing commits, display diff (source: tig; click images for larger variants)

As I wrote: close (but no cigar). It definitely fits my basic needs (all listed requirements and even the "strongly preferred" part), and it's what I use for now. But the "intuitive usage" part is not fully complete (well, once you get used to the shortcuts you can use it intuitively, but until then…). The condition of "Gitnight Commander" is not met: no "help mode" to show the keys one needs, for example. So I'm still open for alternative recommendations.

| improve this answer | |
  • According to tig: h key triggers the help mode. – thetonyrom Feb 21 '19 at 14:45
3

Lazygit

Lazygit (written in Go using the gocui library) fits all my needs. It’s simple, intuitive for user that doesn’t know Vim or Emacs and it gets the job done.

Notable features:

  • adding files easily - a
  • staging files one by one (space) or en masse (a)
  • committing files (c) and signing commits using PGP
  • resolving merge conflicts (interactively) - m
  • easily check out recent branches - a
  • scroll through logs/diffs of branches/commits/stash
  • quick pushing (P) and pulling (p)
  • squash down (s) and rename commits (R)
  • stashing changes (S)

lazygit tui animated preview

grv

For viewing Git repos, there is the Git Repository Viewer with keyboard controls similar to Vim.

  • Commits and refs can be filtered using a query language.
  • Changes to the repository are captured by monitoring the filesystem allowing the UI to be updated automatically.
  • Organised as tabs and splits. Custom tabs and splits can be created using any combination of views.
  • Vi like keybindings by default, key bindings can be customised.
  • Custom themes can be created.
  • Mouse support.
  • Commit Graph.

grv screenshot

| improve this answer | |
  • Good picks, thanks and +1! Will look into them. Just took a quick look at grv (as it offers a single statically linked binary for download), looks quite impressive :) – Izzy Feb 5 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.