Steps to Install and Configure GIT (using SSH key) on MacOS - Apple Silicon

Puneeth Prakash
1 min readMay 1, 2023

--

  1. Install “HomeBrew” (Package Manager) — if you don't have it installed already:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$ echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/$USER/.zprofile
$ eval $(/opt/homebrew/bin/brew shellenv)
$ echo 'export PATH="/opt/homebrew/bin:$PATH"' >> $HOME/.zshrc

2. Install “git” using “brew”:

$ brew install git
$ git --version

3. Setup “git” with your username and email:

$ git config --global user.name "your_name"
$ git config --global user.email "your_emailID"
$ git config --global color.ui true (optional)

4. Create a public/private key pair and copy the public key to the clipboard:

$ ssh-keygen -t rsa -C "your_emailID"
$ pbcopy < ~/.ssh/id_rsa.pub

5. Configure your Github account to use this ssh key

6. You can login to “git” from Mac Terminal:

ssh -T git@github.com
Expected Output :
Hi TheLearnLoop! You've successfully authenticated, but GitHub does not provide shell access.

--

--

Puneeth Prakash
Puneeth Prakash

Written by Puneeth Prakash

I work as a Subject Matter Expert in FMW at Oracle. This blogging space is to share my learning experiences. Views expressed here are solely my own.

No responses yet