Skip to content

Instantly share code, notes, and snippets.

@gdestree
Created August 1, 2016 12:41
Show Gist options
  • Save gdestree/6b41687fcc3479a44b631146557f53bb to your computer and use it in GitHub Desktop.
Save gdestree/6b41687fcc3479a44b631146557f53bb to your computer and use it in GitHub Desktop.
0. Update Your Operating System
If you are using OS X, you should upgrade to at least Mavericks if you haven't already. You can get it from the App Store on your computer, and it's free. To find out which operating system you're running, open the "About this Mac." Under OS X, you should see a version. Mavericks (10.9) and Yosemite (10.10) will both work for Phase 0. If you're using El Capitan (10.11), you'll need to install an extra app in step 2, but it's free.
Before installing, it's always good practice to back up your hard drive, so you don't lose anything!
1. Download Sublime Text
Similar to how you might use Pages or Word to edit a document, or Excel or Numbers to edit a spreadsheet, you need a certain sort of editing program to write and edit code. Lots of text editors can do the job, but in this course, you'll use Sublime Text as your text editor. Sublime is available for free download on their site (Links to an external site.). Make sure to move it to your applications folder. You can choose to download either Sublime Text 2 or 3.
You don't have to purchase your license right away -- you can "cancel" out of the dialog box as many times as you would like.
Go ahead and open Sublime to verify that you've installed it successfully (and to officially complete the installation, as Sublime creates a few necessary preference files in the background the first time you run it).
2. Install Command Line Tools
Open your terminal. You can find it by pressing Command + space, then typing "terminal" and hitting Enter. Your terminal, aka Terminal, aka "the command line," gives you a direct way to communicate with your computer. Note that if you're using El Capitan, you may want to install iTerm (a Terminal alternative) from the App Store, and use that as your terminal instead. Students have run into a few minor bugs using the regular Terminal app on El Capitan with this curriculum.
Anytime we tell you to run a command in your terminal, we mean that you should type it (or paste it, which is a handy way to reduce errors) into Terminal and press Enter. When we give you multiple commands (one per line), you should run each one separately, in order.
Go ahead and try it out by running
xcode-select --install
Follow the prompts to complete the install.
3. Install Homebrew (aka Brew)
Brew is like the app store for the command line. If you ever need any command-line tool, try installing it with Brew before other methods. (ex. brew install name-of-thing)
Install Brew by copying and pasting this beautiful code into your terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It will prompt you for your password, so be ready to type it in. When you type passwords into your terminal, nothing will appear on your screen to indicate that you're typing letters in. This is an intentional security feature, even if it feels a bit odd. Type normally and hit Enter.
4. Set up Your Path
First you need to clone this GitHub repository into your computer and install the files. Type or paste each line separately:
git clone https://github.com/supertopher/dotfiles.git
cd dotfiles
./install
Note This will change how your current terminal will appear. Check your .bash_profile to see what we changed!
Installing these files will configure your bash profile, enable autocomplete, always display rspec with color, and allow you to use "subl" as a shortcut to open sublime.
If it runs properly, you will have a new line. The bash convention is to succeed silently, which means to not give a success message, only error messages.
Add these aliases to your .bash_profile
alias c="clear"
alias ..="cd .."
alias be="bundle exec"
alias gs="git status"
alias gb="git checkout -b"
alias ga="git add -A"
alias gc="git commit -m"
alias gi="git init"
alias rs="rails server"
alias rc="rails console"
5. Upgrade Git
In your terminal, run
brew install git
This installs a potentially newer version of git than your system already had, along with autocompletion for git.
6. Configure Git
You then need to overwrite .gitconfig to your own username and password in GitHub. Use the following format (using your name and email address instead, unless your name is Eleanor Roosevelt and you snagged that amazing Gmail address):
git config --global user.name "YOUR NAME"
git config --global user.email your@email.com
Now make Sublime Text your preferred editor for git:
git config --global core.editor "subl -w"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment