Skip to content

Instantly share code, notes, and snippets.

@fscm
Created March 24, 2020 11:48
Show Gist options
  • Save fscm/31eb55322cf33ea521d98ee5c2a1b4b4 to your computer and use it in GitHub Desktop.
Save fscm/31eb55322cf33ea521d98ee5c2a1b4b4 to your computer and use it in GitHub Desktop.
[macOS] Install gitlab cli

[macOS] Install gitlab cli

Instructions on how to install the GitLab's command-line tool gitlab.

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

Install

gitlab can be obtained via rubygems.

Install the gitlab cli using the following command:

gem install gitlab --quiet --silent --no-document --user-install

To make the executables, that were installed with the previous command, available the following line will have to be added to the .bash_profile file:

export PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:${PATH}"

Alternative Install

Alternatively, you can install the executables to an existing bin folder already included in the PATH environment variable by using the --bindir </path/to/exisiting/bin_dir> option.

An example using the .bin folder in your home directory would be:

gem install gitlab --quiet --silent --no-document --user-install --bindir "${HOME}/.bin"

Verify

Run the following command on a terminal window:

gitlab --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment