Git

What's a developer without Git? To install, simply run:

brew install git

When done, to test that it installed fine you can run:

git --version

And which gitshould output/usr/local/bin/git. If not, try restarting the terminal.

Next, we'll define your Git user (should be the same name and email you use for GitHub):

git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"

They will get added to your .gitconfig file.

To push code to your GitHub repositories, we're going to use the recommended HTTPS method (versus SSH). So you don't have to type your username and password every time, let's enable Git password caching as described here:

git config --global credential.helper osxkeychain

SSH Keys

You can generate ssh keys for your machine by running

ssh-keygen

Then, press enter thrice.

You can checkout your public key by navigating to

cd ~/.ssh

Type ls -a and you should be seeing id_rsa (your private key) and id_rsa.pub (your public key)

Then type cat id_rsa.pub to see your public key so you could copy paste it to your Github/Bitbucket

Last updated