Using tig to cherry-pick across branches
If you know my dev style, you know that I love tig
. For the past few years I’ve used it almost exclusively for one thing: staging/unstaging individual lines or chunks of code. For this task, tig
is without peer. It is so good at it that I neglected, for years, to explore the other features of tig
more fully.
Today I learned that it’s possible to git cherry-pick
commits across branches entirely in one session. To do this, first run tig
(I sometimes do this inside of nvim
using <Leader>g :Te<CR>:term tig<CR>
- this opens tig
in a terminal nested inside of an nvim
session). This will open the main view, which shows the commits for the currently checked out branch, in all it’s DAG goodness. Pressing r
at this point will bring up the references view.
A git reference is a pointer to a git commit. Branches are references - human readable names that, while the name itself is static, point to...