Live data from Hacker News

Tig – Text-mode interface for Git

jonas.github.io

41–50 of 98 posts

Re: Tig – Text-mode interface for Git

#41
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.

Re: Tig – Text-mode interface for Git

#42

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.

Uhm, you didn’t see the featured “Screenshots” item in the main navigation?

He did say "prominent". I agree, inline screenshots on the site are preferable to a Flickr gallery.

Re: Tig – Text-mode interface for Git

#43

Gitui is a better alternative https://github.com/extrawurst/gitui

> 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.

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.

Re: Tig – Text-mode interface for Git

#45

Earlier quoted context omitted.

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.

Interesting, thank you! I think I need go learn more about what "curses" means

"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

Re: Tig – Text-mode interface for Git

#46

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.

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.

Re: Tig – Text-mode interface for Git

#47
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

Re: Tig – Text-mode interface for Git

#49
post #5

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.githubuse…

+1 Tig is awesome!
Post reply on HN