dayonehk.com

Exploring Tig: A Command-Line Alternative to GitKraken

Written on

Chapter 1: Introduction to Tig

In the world of development, tools such as SourceTree and GitKraken are widely recognized for their ability to visualize commit histories and differences, making repository navigation more user-friendly. However, these graphical interfaces lose their effectiveness once you transition to the terminal, particularly when connecting to remote servers. Furthermore, these desktop applications are designed primarily for mouse usage, whereas many developers prefer the speed of keyboard navigation.

To address this, we can turn to tig, a command-line repository browser that brings efficiency back to terminal usage.

Installation

Installing tig is straightforward. For users on common Linux distributions, you can easily install it using your package manager. On Ubuntu, for instance, you would run:

sudo apt install tig

Mac users have the option to use Homebrew:

brew install tig

Windows users can take advantage of Git for Windows, which includes tig by default. If you're eager to use the latest version, you can compile it from the source as detailed on tig's official website.

How to Utilize Tig

After tig is installed, navigate to a directory housing a Git repository and launch tig via the command line. You will be greeted with a primary view displaying commit details at the bottom, akin to the output of git log --oneline. Use the arrow keys to scroll through the commits, and pressing Enter will reveal the details of a selected commit. To return to the list, simply hit 'q'. Pressing 'q' again will exit tig.

Tig features multiple views; the commit list is known as the main view. You can effortlessly return to this view by pressing 'm'. The diff view, which provides detailed information about a commit, can be accessed by pressing 'd'. You can toggle between these views using 'm' and 'd' respectively.

Overall, tig's navigation is reminiscent of vim or less, and initiating a search in the current view is as simple as typing a slash.

The first video titled "Best Git GUI's Compared 2022" dives into various Git GUI tools, comparing their features and usability.

Tig's extensive functionalities allow for versatile repository exploration, and you can discover its full range of features and key bindings by pressing 'h'.

Configuration of Tig

Tig is highly customizable. To modify its settings, create a file named .tigrc in your home directory. The structure for adding settings is straightforward:

set variable = value

For example, to display 25 lines before and after each diff, you can add:

set diff-context = 25

While tig comes with sensible default settings, users can tailor their experience based on personal preferences, with numerous options available on tig's website.

Recap

In summary, tig is an exceptional command-line repository browser that enhances the experience compared to SourceTree and GitKraken, especially for keyboard-centric users. If you are accustomed to vim or less, you will find tig intuitive and efficient.

Give tig a try!

Chapter 2: Enhancing Your Git Experience

The second video, "GitKraken Makes Git Even More Awesome - And Easy to Use," showcases how GitKraken simplifies Git operations and enhances user experience.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

# The Power of Low Margins: How Giants Thrive in High Volume Markets

Discover how major retailers thrive with low profit margins through high volume sales.

Insights from

Exploring key lessons from Seth Godin's

# Mind Cafe's Current Status: A Semi-Hiatus Explained

Discover why Mind Cafe is currently on a semi-hiatus and what it means for writers seeking feedback and submissions.

Unlocking Your Potential as a Writer: Essential Practices

Discover the key practices that can elevate your writing skills through reading and consistent practice.

Life Is Both a Dance and a Shelter: Embracing Duality

Explore the dualities of life—how we navigate challenges and celebrate moments of joy.

The Return of DDT: A Cautionary Tale from History

A look into the resurgence of DDT, its historical context, and the ongoing battle between corporate interests and public health.

Navigating Life with Retinitis Pigmentosa: A Personal Journey

A firsthand account of living with Retinitis Pigmentosa, detailing the challenges faced and the resilience required to overcome them.

Discovering Saturn's Mysteries: The Fuzzy Core Revelation

A groundbreaking study reveals Saturn's core is not compact but a vast, diffused mixture, reshaping our understanding of gas giants.