Git tools: tig etc

Saturday 23 February 2019

Recently I’ve had a few chats with engineers where I mention a git helper thing, and they hadn’t heard of it. So maybe other people would like to hear about them too:

tig is a full-window terminal UI for git. It’s great for spelunking through a git repo, looking at branches, history, blames, and so on. For a quick overview of what it does, this old blog post from Atlassian describes it pretty well.

You should play with it to see all of its features. To be honest, I haven’t quite internalized how it displays new panes, but I still love it for its speedy compact presentation of just the information I want.

hub is a command-line tool for doing GitHub things that are not pure git, or for supplying helpful GitHub-centric defaults. For example, cloning a repo with “hub clone username/repo”, or opening a pull request for the current branch with “hub pr”. It can do a ton of stuff. If you use a lot of GitHub features, but like the command line, you should definitely give it a try.

A global .gitignore file is like the .gitignore file in your repos: it specifies files that should never be committed to git. But instead of being part of a specific repo, this one is global to all of your repos on your machine. This is great for IDE-specific files, or data files for your own quirky tools.

Do you have other good helpers to recommend?

» 7 reactions


Eric D Hanchrow 7:24 PM on 23 Feb 2019
Well, "magit" is the best UI for anything I've ever seen. But it runs inside Emacs, and Emacs is so weird that I can't recommend learning it just to use magit. But if you've always meant to try out Emacs ...
1. Few people seem to know about the awesome -vv option for git branch.

2. Here's a way to make git log more compact and informational.
Add the following to your ~/.gitconfig file:
        logp = log --pretty=format:'%C(red)%h %C(blue)%<(16,mtrunc)%an %C(green)%<(21,trunc)%ci%x08%x08 %C(reset)%s %C(yellow)%D%C(reset)'
Now try git logp in a repo.
Edison Gustavo Muenz 8:04 AM on 24 Feb 2019
I like to use git-cola to write commits.

It's a very simple user interface with support to staging parts of the files, ammending, loading previous commit messages.
Godefroid Chapelle 11:50 AM on 24 Feb 2019
Vim users should definitely check tpope Fugitive plugin. Its latest evolution makes it even better.
I'm a big fan and happy paying customer of the SmartGit GUI client.
The latest useful git tip I can share is `includeIf`:
With it you are able to make gitconfigs conditional.
I use it so it auto-switches between my working and personal email depending on a folder name.
vimagit isn't quite Magit, but it's enormously changed how I commit, and very much for the better:

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.