New to programming on mac, don't worry we got you covered 🥳
-
Install xcode-select
To install
xcode-select
follow the following steps :--
Open the terminal, use shortcut
command + space
and type terminal in the search -
Run the Command
$ xcode-select --install
-
When prompted, enter the login password
-
To check for successful, type
xcode-select
. You should see something like:-$ xcode-select xcode-select: error: no command option given Usage: xcode-select [options] Print or change the path to the active developer directory. This directory controls which tools are used for the Xcode command line tools (for example, xcodebuild) as well as the BSD development commands (such as cc and make). Options: -h, --help print this help message and exit . .
-
-
Install Homebrew
-
Open
Terminal
-
Paste this line and hit enter
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Type
brew doctor
to confirm successful install type:-$ brew doctor Your system is ready to brew
-
-
Install Git
-
Open
Terminal
and type :-$ brew install git
-
Type
git
to confirm success, you see this on output :-$ git usage: git [--version] [--help] [-C <path>] [-c <name>=<value>] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] [--super-prefix=<path>] [--config-env=<name>=<envvar>] <command> [<args>] These are common Git commands used in various situations: start a working area (see also: git help tutorial) clone Clone a repository into a new directory init Create an empty Git repository or reinitialize an existing one . .
-
-
Configure Git
-
Open
Terminal
-
Type the following to set up your git configuration: - ( Replace with your name and email )
git config --global user.name "<your name>" git config --global user.email <your email> git config --global init.defaultBranch main git config --global pull.rebase false
-
Type
git config --list
to verify. Checkout for this output :-$ git config --list core.repositoryformatversion=0 core.filemode=true core.bare=false credential.helper=osxkeychain user.name=<your name> user.email=<your email> init.defaultbranch=main pull.rebase=false
-
-
Add Github SSH
We are assuming that you already have a github account.
-
Generate a New Key
Open termianak and enter the following command :-
$ ssh-keygen -t rsa -C "<your email"
-
Press Enter when prompted to enter a file, this will save the keys to the default location i.e.
~/ssh/id_rsa
-
When prompted to enter a password, when you hit enter without typing anything that means
no password
. Which is okay. -
The output in the
Terminal
should look like this :-Your identification has been saved in id_rsa. Your public key has been saved in id_rsa.pub. The key fingerprint is: SHA256:C3AB8FF13720E8AD9047DD39466B3C8974E592C your@email_address.com The key's randomart image is: +---[RSA 2048]----+ | . = .. | |o . . o + = .. | | =.o o o o o . | |+ +o. . .. . . | |.+E . S o o..| |.. . .o . .+| | o oo .o+| | . o ==o.=| | . .+=B=o | +----[SHA256]-----+
Awesome! You have your
private
andpublic
keys saved 🎉
-
-
Add the new key to your system
In your Terminal, run :-
$ ssh-add ~/.ssh/id_rsa
-
Copy
public key
In your terminal run :-
Note: Never display show your
private key
to the public 🛑$ pbcopy < ~/.ssh/id_rsa.pub
-
Add key to Github
- Visit Github Key Settings
- Click on
New SSH key
- Paste the key copied in part 3 above (
command + v
) in thekey
section - You can choose to add a title or not, based on your preference.
- Click on
Add SSH key
to save your key to Github
-
Verify if the configuration worked.
-
In your terminal run :-
$ ssh -T [email protected]
-
You will get this prompt,
The authenticity of host 'github.com (192.30.252.153)'... can't be established. RSA key fingerprint is 00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff. Are you sure you want to continue connecting (yes/no)?
Type
yes
-
If successfull, yoy will see :-
Hi <your_github_username>! You've successfully authenticated, but GitHub does not provide shell access.
-
-
-
Install rbenv
To install rbenv on your computer click this link and follow the prompts Here
Note:
- Newer MacBooks uses
zsh
notbash
for shell. - In the link they use
.bash_profile
replace that with.zshrc
- Newer MacBooks uses
-
Install NVM
To install nvm on your mac, click the link and follow from step 1 - 3 Here
Note:
- Newer MacBooks uses
zsh
notbash
for shell. - In the link they use
.bash_profile
replace that with.zshrc
- Newer MacBooks uses
-
Install PostgreSQL
To install postgresql with home brew use click on the link Here