Skip to content

Instantly share code, notes, and snippets.

@fscm
Last active October 10, 2019 15:49
Show Gist options
  • Save fscm/8b0344179133d1d9d0ad519363e90405 to your computer and use it in GitHub Desktop.
Save fscm/8b0344179133d1d9d0ad519363e90405 to your computer and use it in GitHub Desktop.
[macOS] Install 'tig' command from source

[macOS] Install 'tig' command from source

Instructions on how to install the tig command on macOS from source.

Prerequisites

macOS Command Line Tools need to be installed on your local computer.

To install the Command Line Tools run the following command:

xcode-select --install

Get the source

To obtain the tig source code run the following commands:

mkdir -p ~/.src/tig
curl -sL --retry 3 --insecure "https://github.com/jonas/tig/releases/download/tig-2.4.1/tig-2.4.1.tar.gz" | tar xz --no-same-owner --strip-components=1 -C ~/.src/tig/
cd ~/.src/tig

Configure

To configure the source to be compiled for macOS run the following command:

./configure \
  --prefix=/usr/local \
  --mandir=/usr/share/man \
  --sysconfdir=/etc

Build

To build the source code run the following command:

make

Install

To install the tool run the following commands:

sudo make install
sudo make install-doc-man

Clean up

After installing the tool you can remove the downloaded source code using the following commands:

cd ~
rm -rf ~/.src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment