Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oldaccountarchived/9960013 to your computer and use it in GitHub Desktop.
Save oldaccountarchived/9960013 to your computer and use it in GitHub Desktop.

The Hitchiker's Guide to Git, C++, and Sublime Text on Windows

by Jacob Jenkins, Mac user.

This guide is for COP 3503 at the University of Florida.

Overview

First, get these installers:

  • msysGit (Git-1.9.0-preview20140217.exe): here
  • GitHub for Windows: here
  • Sublime Text 2: here

Git on the Command Line

Installing msysGit for Fun and Profit!

msysGit provides a command line installation of Git, and includes some other crucial tools like gcc (The GNU C Compiler, found on the Ubuntu installations in the CISE lab computers) and make.

Double-click Git-1.9.0-preview20140217.exe and hit next all the way to Sunday.

The installer will probably open a killer .rtf file with release notes which you can ignore.

Using msysGit with Github

Generating a Key

Press the Windows key and type "Git Bash" without quotes. A command line window should open.

In the newly opened window type ssh-keygen -t rsa -C "your_email@example.com" replacing your_email@example.com with your actual email, unless your email address is in fact your_email@example.com which is totally cool by me.

Next you should see a message similiar to this one. Follow along with the bracketed [blahblahblah] statements.

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press Enter]
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
Your identification has been saved in /c/Users/you/.ssh/id_rsa.
Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com

Next type eval $(ssh-agent) and then ssh-add ~/.ssh/id_rsa.

Now we need to get that key we generated into Github.

Getting to Github

First we need to copy that key we generated.

  • Navigate to C:\Users\your_name.ssh\
  • Right click id_rsa and click Open With...
  • Select Notepad.
  • Copy the contents of the file.

Next we need to add it to Github.

  • Login to Github.
  • Go to your Account Settings.
  • Click SSH Keys in the left sidebar.
  • Click Add SSH key
  • Paste your key into the "Key" field
  • Click Add key
  • Confirm the action by entering your GitHub password
  • Profit?!?!

You did it!

Using mysyGit's Unix Utilities

Unix pretty much kicks ass. Necessary Video.

msysGit comes jam packed with tons of Unix fun.

Example commands:

  • cd changes directory cd ~/some_directory/.
  • ls lists all files in your current directory.
  • ls -a lists all files in your current directory including those beginning with a period.
  • gcc compiles C programs.
  • g++ compiles C++ programs.
  • gdb a killer command line debugger.
  • git allows you to use git on the command line.
  • make builds programs using the Makefile in a directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment