Originally from Joseph Brown. Editing this now
Get Git (Do Once)
If you do not have git (needed for both BitBucket and GutHub) installed, go here:
If this is your first time using git, you will need to configure it. In a Terminal, type:
git config –global user.name “first last”
git config –global user.email email@example.com
Set Up A Public SSH Key (Do Once)
Pushing code is to Bitbucket/GitHub is crazily simple. However, before doing that, we will set things up so you will not have to enter your password every time you want do something. To do this, we will create and upload a public ssh key.
Do NOT do this step if you already have set up ssh-keys, e.g. if you did this previously for GitHub (an ssh key can be reused, and this will overwrite any existing keys). In Terminal:
ssh-keygen -t rsa -C “firstname.lastname@example.org”
Use the email associated with your Bitbucket/Github account. It will ask you for a passphrase. Just hit Enter (for empty passphrase). Your public key will be saved in ~/.ssh/id_rsa.pub.
Set Up BitBucket Account (Do Once)
Sign up if need be. Make sure to use an academic email address, as this entails free unlimited space.
Select “Manage Account” from your user menu. Then, select “SSH keys”, and click on “Add key”. It is important that the key is formatted exactly (e.g. does not contain spaces), so we need a dependable way to copy/paste. We’ll use the clipboard.