How to Setup Git on Windows & Mac

Step 1: Add your PC/Mac ssh key to your account.
1. If you are using Mac run following commands in Terminal window or if you are using Windows install GitBash command utility ( https://gitforwindows.github.io ) to run following commands.

Step 2. Create your SSH Keys:
2.1.Before generating an SSH key in your shell, check if your system already has
one by running the following command:

 cat ~/.ssh/id_rsa.pub

2.2.if keys are not there then generate a new SSH key, use the following
command:

ssh keygen -t rsa -C"$your_email"

Note:This command will prompt you for a location and filename to store the
key pair and for a password. When prompted for the location and filename,
just press enter to use the default.
2.3. To copy your public key to the clipboard, use the code below. Depending on
your OS you’ll need to use a different command:

 For Windows: clip < ~/.ssh/id_rsa.pub
 For Mac: pbcopy < ~/.ssh/id_rsa.pub

Step 3. Open Git repository from you credentials and Add your SSH Key
3.1. On the left side menu, click on “profile settings” and then click on “SSH Keys”:

Screen Shot 2016-08-31 at 11.43.36 AM

3.2. Then click on the green button “Add SSH Key”

3.3. There, you should paste the SSH Key which you copied from command line.

Screen Shot 2016-08-31 at 11.43.52 AM

Note:Now, you’ll be able to use Git over SSH

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s