[HN Gopher] Tig - Text-mode interface for Git
       ___________________________________________________________________
        
       Tig - Text-mode interface for Git
        
       Author : lemonspat
       Score  : 238 points
       Date   : 2020-12-16 14:00 UTC (9 hours ago)
        
 (HTM) web link (jonas.github.io)
 (TXT) w3m dump (jonas.github.io)
        
       | bxrxdx wrote:
       | I love tig.
        
       | dionian wrote:
       | I use this quite a bit for ad-hoc git log viewing in bash. Thanks
       | to the developers!
        
       | smitty1e wrote:
       | Mandatory plug: https://magit.vc/
        
         | chipotle_coyote wrote:
         | And for Vim nerds: https://github.com/tpope/vim-fugitive
         | 
         | (I tend to be using different editors most of the time, but
         | haven't found a text editor Git integration better than either
         | Magit or Fugitive.)
        
           | falkd wrote:
           | There is also Vimagit, which is inspired by Magit:
           | https://github.com/jreybert/vimagit
        
         | RMPR wrote:
         | That's the first thing that drove me initially to Emacs. I
         | never found a Git client that well-crafted.
        
           | globular-toast wrote:
           | That's because most aren't designed as git porcelains. Magit
           | enhances and, in some cases, replaces git's abstractions with
           | its own. If a git frontend starts by taking git's own built-
           | in porcelain as a given then it's already doomed to failure.
        
             | ajarmst wrote:
             | I've been using Magit for years, but I've never seen the
             | use of "porcelain" as a jargon term to describe anything
             | but Magit. Can you point me to a 'splaner on the use of
             | that term? Googling hasn't gotten me anything but an
             | insight to just how many people take porcelain (the
             | pottery) very, very seriously.
        
               | simias wrote:
               | It's silly git nomenclature for "human readable output".
               | Except it's not even used consistently within git.
               | 
               | What the parent mean is that some tool rely on the human-
               | oriented, potentially unstable output of git commands
               | instead of using lower level layers.
        
               | lapinot wrote:
               | https://git-scm.com/book/en/v2/Git-Internals-Plumbing-
               | and-Po...
               | 
               | tldr: git low-level commands are considered API and
               | called "plumbing" (eg `git cat-file`, `git upload-pack`),
               | otoh stuff like `git push` is porcelain: it's an ui
               | layer.
        
               | globular-toast wrote:
               | It's a git specific terminology. The plumbing is low
               | level stuff like creating objects etc (ie. DAG
               | operations). The porcelain is high level stuff like
               | "rebase" which is (supposedly) designed for human use.
        
       | ktzar wrote:
       | Using it for years. Pretty good and it's even included in the
       | latest versions of git for windows (if you can't use something
       | else, as it was my case for a while)
        
         | GordonS wrote:
         | Thanks, I was just trying to find out where to download Windows
         | binaries, and had no idea I already had it!
        
       | evnix wrote:
       | a simple video demo/gif would be really cool to see what it does
       | in one glance
        
       | skocznymroczny wrote:
       | In Poland in the 90s there was a spreadsheet application for DOS
       | named TIG. It was a companion to word editor named TAG.
        
       | dag11 wrote:
       | I'd like to just say that Tig has been deeply integrated into my
       | terminal git workflow for so many years, it's one of the first
       | things I install on any new system. I've found that practically
       | all GUIs for git only serve to be a shell for the same commands
       | you'd be quicker typing out in the first place, and their only
       | unique value is a visual representation your branching and the
       | ability to quickly stage/unstage chunks of code within a file.
       | Tig brings these two tasks beautifully into any command line
       | workflow, loading instantly and having good keyboard shortcuts <3
        
         | tcoff91 wrote:
         | I'll have to try it and see how it compares to Magit. Magit is
         | by far my favorite way to interact with git. I do work on a
         | repo currently however that brings Magit to its knees
         | performance-wise, so I'll have to see if Tig performs better
         | with it.
        
       | knubie wrote:
       | Been using tig for years and couldn't imagine going back. I love
       | how closely it maps to the standard git CLI.
        
       | randylahey wrote:
       | I've been using tig a lot recently; I've always just used git
       | from the command line, but if you're working with a number of
       | files, tig is hard to beat when you learn a few of the hotkeys.
        
       | nathias wrote:
       | tig really is great, I've been using it for years now
        
       | kissgyorgy wrote:
       | My favorite is lazygit: https://github.com/jesseduffield/lazygit
       | 
       | It has better layouts and shortcuts. I used Magit before, but
       | hated to install Emacs only for such a small feature set. Lazygit
       | is perfect when you want to manipulate a git repo quickly, but
       | very similarly to Magit.
        
         | tcoff91 wrote:
         | Excited to try this. I work in this one massive repo that Magit
         | just can't handle. Pulling up the Magit status window takes
         | 15-25 seconds on a 2019 15" MBP with an 8-core i9. It's torture
         | because I'm so used to Magit that I hate having to change my
         | workflow for one repo. I hope lazygit is faster than Magit.
        
       | pengaru wrote:
       | As a longtime vim user it feels like if I actually wanted a TUI
       | veneer over the git CLI I'm already quite familiar with, I'd
       | prefer it be done within vim as an extension/plugin or something.
       | 
       | Having some vim-like keybindings in non-vim tools is nice, but
       | it's always a far cry from being _vim_. And personally I find it
       | incredibly annoying when I 'm in something vim-like enough to
       | establish "I'm in vim" expectations and not meet them once I
       | start trying to use the thing like vim without restraint. I'm
       | then put into this constant second guessing mode of "if this
       | _really_ were vim I 'd do so and so, but should I just try it?
       | maybe it'll do something really unexpected, time to RTFM? sigh."
       | which is really unproductive and psychologically awful.
       | 
       | Especially when we're talking about dev tools like git
       | integration, where the mental state is already going to be
       | steeped well into text editor land, all the familiar vimisms are
       | going to be hot in the habitual cache.
       | 
       | Does anyone know of anything tig-like that's implemented as a vim
       | plugin one interacts with through regular vim windows? I wouldn't
       | mind having an interactive list interface for tagging files to
       | include in a `git commit -p` for instance, without leaving the
       | editor.
        
         | wrboyce wrote:
         | I'm a big fan of tpope's fugitive:
         | https://github.com/tpope/vim-fugitive
        
       | xyproto wrote:
       | Tig is and has been my favorite utility for browsing git logs for
       | years now. Thanks tig developers and contributors!
       | 
       | It's handy to know that the arrow keys are used for browsing the
       | log messages, while return followed by either pgup/pgdn or j/k
       | are used for scrolling the contents of a log message. And it's
       | easy to search logs with /.
       | 
       | Tig is also theme-able. For instance with:
       | 
       | curl -so ~/.tigrc
       | 'https://raw.githubusercontent.com/cbertoldi/dotfiles/master/...'
       | 
       | Note that this may overwrite your ~/.tigrc, if you already have
       | one. Colors are subjective, but I like how it looks in my
       | terminal emulator.
       | 
       | Tig is highly recommended. It just works and is one less thing to
       | worry about.
        
         | mkhnews wrote:
         | I will also say tig is awesome. I use it all the time and have
         | submitted a few PRs to it for my particular idiosyncrasies.
         | Vim's gv plugin is also good.
        
         | al3ssapa wrote:
         | +1 Tig is awesome!
        
         | ausjke wrote:
         | same here also it's much faster to open when you have a really
         | large repository
        
         | CoolGuySteve wrote:
         | tig along with htop, tmux, ag, and vim are always the first
         | packages I install on any new host. They're indispensable.
        
         | simlevesque wrote:
         | curl -so ~/.tigrc 'https://raw.githubusercontent.com/cbertoldi/
         | dotfiles/master/tigrc.symlink'
        
       | cphoover wrote:
       | Ahhh one of my fave command line utilities, super useful git
       | tool.
        
       | tnorthcutt wrote:
       | _text-mode interface for Git_
       | 
       | Based on the comments here saying they love Tig, I know I'm
       | missing something, but: doesn't Git provide a text interface (the
       | `git` command) to Git?
       | 
       | I'm not trying to be obtuse; I genuinely don't know what Tig
       | provides that Git doesn't already do, but would love to know!
        
         | masklinn wrote:
         | tig is a curses program, it's an interactive terminal GUI (a
         | TUI), as opposed to a CLI e.g. you can browse and interact with
         | your log rather than dump it in a pager and need a separate
         | terminal to dive into a commit or whatever.
         | 
         | magit is a good alternative, it's not exactly a TUI because it
         | works entirely inside emacs and uses emacs concepts, but it's
         | entirely text-based.
        
           | tnorthcutt wrote:
           | Interesting, thank you! I think I need go learn more about
           | what "curses" means
        
             | httpsterio wrote:
             | Curses is just a library for writing command line
             | interfaces. Normally a CLI just deals with the text buffer
             | pushing content and the user inputting textual commands,
             | curses allows for a bit more control like with panes,
             | dynamic areas and giving the user more control on how to
             | input commands.
        
             | acoard wrote:
             | "Curses" is a library for writing, well, TUIs[0]. I get
             | that's a bit circular, so let me explain.
             | 
             | With a normal CLI program, you essentially just output to
             | STDOUT line by line. You type `git status`, and the git
             | program basically does `print(status)`. Then you're back to
             | your terminal and you type another command, git or
             | otherwise.
             | 
             | A "curses" program renders fundamentally different. It's
             | much more like how video games render. Every time it
             | renders, it'll draw to the entire screen. You're not in an
             | empty command line where you can type any command, rather
             | you are "in" the application. Take a look at this
             | screenshot [1]. You can imagine how pressing up/down keys
             | might move which input is selected. If you want to get back
             | to the normal terminal you have to quit the TUI
             | application.
             | 
             | While not commonly thought of TUIs, generally
             | vi/emacs/lynx/etc would all technically qualify (tho people
             | might give you a strange look if you called them TUIs). To
             | be clear, these do _not_ use curses. They kind of predate
             | curses and just wrote it manually. Curses is not a
             | requirement ffor a TUI, but is by far the most common
             | library to use when writing TUIs now-a-days.
             | 
             | [0]
             | https://en.wikipedia.org/wiki/Curses_(programming_library)
             | 
             | [1] https://i.stack.imgur.com/oD7mJ.png
        
               | ephimetheus wrote:
               | Actually, curses uses two buffers and diffs them so that
               | only the delta is sent ,,over the wire". In graphics,
               | everything is redrawn every frame usually.
        
         | tgvaughan wrote:
         | It provides a curses-based TUI, while generally git just
         | provides a CLI.
        
         | bkane521 wrote:
         | Tig provides a GUI that is text-based, i.e. runs right in your
         | terminal. It's essentially a shell friendly version of
         | sourcetree/tortoisegit etc. A great tool on its own, but
         | particularly useful for headless servers/remote machines.
        
           | tnorthcutt wrote:
           | Interesting, thank you!
        
       | metaodi wrote:
       | tig is great, it's my go-to git client on all my machines.
       | 
       | Only since I use tig I understand how to commit hunks. It's super
       | easy to split the changes of a file into different commits that
       | make sense. With most other clients this is either cumbersome or
       | not possible. So your forced to always commit all changes of a
       | file in one commit.
       | 
       | I guess it just really works great for my workflow and the way I
       | think about my repositories/commits.
        
         | timidger wrote:
         | Out of curiosity what's wrong with git add -i? That's what I
         | use to stage parts of a file.
        
           | robenkleene wrote:
           | `git add -i` is linear, you have to address files and chunks
           | in order (there are workarounds for this, but they're
           | clumsy). `git add -i` is a bit like using a typewriter,
           | whereas `tig`, which lets you address files and chunks non-
           | linearly, is like using a word processor by comparison. Edit
           | to your hearts content.
        
           | petepete wrote:
           | Tig is just faster, staging and unstaging take a fraction of
           | a second.
           | 
           | I've used Tig daily for years (about ten) and basically use
           | it for for quickly browsing the log and changing what's
           | staged - probably less than 5% of its features.
           | 
           | Everything else I do via the command line with ZSH's
           | excellent git completion.
        
       | hibbelig wrote:
       | Lazygit is an alternative that I like.
        
         | talkingtab wrote:
         | Second lazygit. My personal favorite at
         | https://github.com/jesseduffield/lazygit
        
         | [deleted]
        
         | sli wrote:
         | Started using lazygit a couple months ago and never looked
         | back.
        
         | rplnt wrote:
         | I've been using it for I think well over a year now. Started
         | with using it just to add/remove files from staging. Used git
         | for everything else. Slowly added committing, pushing, creating
         | patches, seeing history, ...
         | 
         | It's quite fast and is easy to add it to your regular git
         | flows.
        
       | chrisweekly wrote:
       | tig seems like it could be a cool tool, but trying to view
       | screenshots (on ios latest safari) left me stuck on a flickr
       | login screen. ):
        
         | aszen wrote:
         | See the video here
         | 
         | https://youtu.be/z0mb0NteYjg
        
         | Timothee wrote:
         | For what it's worth, I don't think the screenshots do it any
         | favor.
         | 
         | The main thing is that it's a terminal-based git client with
         | Vim bindings, and customization. It's hard to represent that in
         | screenshots :)
         | 
         | But I've also been using it for years and it's working
         | perfectly for me.
        
       | spicybright wrote:
       | Why no pictures, I'd like to see it first without installing it
       | to my machine.
        
       | inetknght wrote:
       | I've used `tig` for years and it's wonderful.
        
       | mlang23 wrote:
       | Git already has a text-mode interface, its called Git!
        
       | SomeHacker44 wrote:
       | I did not find any obvious screenshots in action when clicking
       | around on the site. So, I won't bother investigating further.
       | Maybe others would also like some prominent screenshots that show
       | off why we may want to use/try this.
        
         | pmcollins wrote:
         | ditto but i downloaded it anyway and am very glad i did.
         | 
         | btw on mobile, the screenshots are hidden behind the hamburger
         | menu at the top of the page.
        
         | mrapogee wrote:
         | Uhm, you didn't see the featured "Screenshots" item in the main
         | navigation?
        
           | donarb wrote:
           | He did say "prominent". I agree, inline screenshots on the
           | site are preferable to a Flickr gallery.
        
           | jdubb wrote:
           | For those like me who still couldn't find it: there's a small
           | menu button on the top left.
           | 
           | Maybe it's because I'm on mobile, but it's a bit hard to see.
        
             | sli wrote:
             | That's why. The sidebar is open by default on desktop.
        
       | corytheboyd wrote:
       | A timeless classic, have for years and will continue to use it
       | daily
        
       | skibz wrote:
       | Not only is the name just three letters long, it's git backwards,
       | and the acronym text-mode interface for git. Simply perfect.
        
       | keyle wrote:
       | I like tig, then I discovered lazygit, a samish idea in Go which
       | as far as I can tell is more powerful and easier to use. (I have
       | no affiliation to any).
        
       | ninetax wrote:
       | I use tig every day! Love it!
       | 
       | My one wish is that when you go to edit a file from the interface
       | (by hitting e) is that it would keep you in the directory you're
       | in rather than editing the file as if you're in git root. Linters
       | and other things break when I edit files from the root directory
       | in our mono repo
        
       | felixr wrote:
       | Are there any good TUIs for mercurial?
       | 
       | I have only found https://github.com/matheuslessarodrigues/verco
       | which not as good as tig or lazygit
        
       | samuell wrote:
       | Tig is one of the most valuable hidden gems out there.
       | 
       | I use it both for simple things like a good looking commit log
       | (the default view), but like especially how I can navigate into
       | an old commit, hit t (for tree), and navigate and peek into the
       | files available in that specific commit, hit b (for blame) to
       | view which commit changed a particular row etc.
       | 
       | I like how all the different views play together into such useful
       | workflows, and how, just like in vim, everything is available one
       | mnemonic keystroke away. Hit h (for help) inside it to explore
       | ... you will be surprised at the power of using these different
       | views together in practice.
        
       | pacificat0r wrote:
       | Gitui is a better alternative
       | 
       | https://github.com/extrawurst/gitui
        
         | ocardoso wrote:
         | > gitui currently lacks essential features in git like push,
         | pull, and checkout. The priorities are the basics (add,
         | commit), and on features that are making me mad when done on
         | the git shell, like stashes and hunks.
         | 
         | Hardly a better alternative if it doesn't have all the basic
         | features.
        
           | knubie wrote:
           | I've been using tig for years and never did a push / pull /
           | checkout with it. The git CLI works fine for that, so I
           | understand the authors priority here.
        
         | yoz-y wrote:
         | What is the main feature that makes Gutui better than Tig?
        
         | bsg75 wrote:
         | That is subjective. I have not warmed up to curses UIs that
         | have window frames. YMMV.
        
       | vr46 wrote:
       | Love Tig, it's an instant go-to everyday for Getting Things
       | Done(tm)
        
       | qwertywert_ wrote:
       | Really, do you have to link screenshots separately to a flickr
       | page?
       | 
       | Screenshots are super important for projects imo to quickly
       | understand how something is actually useful. Should always make
       | the small effort to add an example GIF or image (if applicable to
       | the project).
        
       | ninetax wrote:
       | Do folks have .tigrc shortcuts they'd recommend?
        
       | desireco42 wrote:
       | I've been using Tig for years. It works, it works well, it is
       | fast and mostly intuitive.
       | 
       | Usually people like it and want to use it after they see me using
       | it.
        
       | topher200 wrote:
       | I'm a huge fan of tig. It maps really well to my way of thinking
       | about git repos and it is super quick way to see the graph of
       | everything that's going on. In the Top 5 of command line tools
       | for me.
        
       ___________________________________________________________________
       (page generated 2020-12-16 23:00 UTC)