GitHub command not found - Mac

Page content

How to Install GitHub Command on Mac

GitHub command line tool is a powerful utility that allows users to interact with GitHub repositories directly from the command line. If you encounter the “GitHub command not found” error on your Mac, follow the steps below to install it.

Why GitHub Command is not Found?

By default, the GitHub command line tool is not pre-installed on macOS. You need to install it manually to use its features.

Installation Steps

  1. Install Homebrew: Homebrew is a package manager for macOS. If you don’t have Homebrew installed, you can do so by running the following command in your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install GitHub CLI: Once Homebrew is installed, you can install the GitHub CLI using the following command:
brew install gh
  1. Verify Installation: After the installation is complete, you can verify it by running:
gh --version

This command should display the version of the GitHub CLI that was installed on your system.

Compatibility with macOS

The GitHub CLI is compatible with macOS and should work seamlessly on your Mac once installed through Homebrew.

Conclusion

By following these simple steps, you can easily install the GitHub command line tool on your Mac and start using its powerful features to interact with GitHub repositories directly from the command line. Happy coding!