Git & Github (part 2)

Github
So now that you have a git repository on your computer, and you can take snapshots of your project at any given time, lets talk about Github.

Github is a place to publicly store your repo on a server. When you do this, you have a backup of all of your commits, and other people can view/collaborate on your project. So how do you get your git repo from your computer onto github?

First, check your git user.name and user.email by opening the terminal and typing:

git config --get user.name

You should see your name show up. Now type

git config --get user.email

you should see your email show up. If you don’t see what you expect, do this:

git config --global user.name "Your Name"

git config --global user.email "your_email@example.com"

You’ll definitely need a github account. Go make one (or log in). Make sure you use the same email address for github that have configured for git! You also need to set up an SSH key, which you can do by following this link

Alright, you’re ready to put your local repo onto github.

First, open your terminal and prove to github that you are in fact who you say you are by typing:

ssh -T git@github.com

You should see a message like the following:

Sweet, Github now trusts you!
Ok, go to github and create a new repository (click your the + icon next your your username)
Give it a name and a description. Preferably the name should match the name of your directory on your computer. I’m calling mine homework_assignments. You probably don’t want to change any of the default options. Leave them as public and DO NOT check the box that says “initialize this repository with a README”

You should see a screen that contains this:

Screen Shot 2014-06-26 at 5.14.53 PM

You’ll want to follow the prompts for “Push an existing repo…”

From then on, whenever you make a commit from your terminal, can can simply type

git push

in the terminal from your git directory, and your commit will now be on github.

Advertisements

About Aaron Glasenapp

I am a freelance Web/Rails developer and a hard core recreational mathematician.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: