Too Cool for Internet Explorer

Thursday, January 1, 2009

github primer: the real one

All the articles I have read about getting started on github are not so “primer”.

Take for instance, my favorite article on getting started with github:

Getting Started with Git and GitHub on Windows.

It does a great job, until the “Set up your GitHub account” picture.

After that it turns specific, and supposes the readers will fork his project…

Others, starts the action by cloning an empty repository, which makes no sense.

This primer, is supposed to be your very first incursion into github, so, I will not give you the entire alphabet, just the “A” letter.

I’m supposing you have already installed your git client and done with your github account, now what?



Everything is empty on my github account. What can I do next?

First you need to create a new Repository:

You just need to fill out this form:


With at least the Project name which will become the Repository name.

Or (that was my case), just rename an unused one with the desired name:


This will let you with something like this:


With your own “Clone URL”, that will be used on the next steps.

Now let’s go and create some content and push it into this new Repository:



Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

E:\GitHub>md mynewgithub

E:\GitHub>cd mynewgithub

E:\GitHub\mynewgithub>git status
fatal: Not a git repository

E:\GitHub\mynewgithub>git init
Initialized empty Git repository in E:/DreamHost/GitHub/mynewgithub/.git/

E:\GitHub\mynewgithub>git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)

E:\GitHub\mynewgithub>notepad readme.textile

E:\GitHub\mynewgithub>dir
Volume in drive E is Dados
Volume Serial Number is 5C89-E09F

Directory of E:\GitHub\mynewgithub

01/01/2009 04:38 PM <DIR> .
01/01/2009 04:38 PM <DIR> ..
01/01/2009 04:37 PM <DIR> .git
01/01/2009 04:39 PM 77 readme.textile
1 File(s) 77 bytes
3 Dir(s) 5,366,173,696 bytes free

E:\GitHub\mynewgithub>git add .

E:\GitHub\mynewgithub>git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: readme.textile
#

E:\GitHub\mynewgithub>git commit -a -m "My first commit on github ever"
Created initial commit f213d62: My first commit on github ever
1 files changed, 3 insertions(+), 0 deletions(-)
create mode 100644 readme.textile

E:\GitHub\mynewgithub>git branch
* master

E:\GitHub\mynewgithub>git status
# On branch master
nothing to commit (working directory clean)

E:\GitHub\mynewgithub>git push -f git@github.com:marcric/mynewgithub.git master
Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 291 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:marcric/mynewgithub.git
+ 2fdc3ed...f213d62 master -> master (forced update)

E:\GitHub\mynewgithub>



And then, supposing this is the “readme.textile” file content:

h1. That is my first github project

h2. And this is my first README file

You will have something like this:


Now it is OK to start forking, cloning, merging and what ever you want to do with git on github.

1 comment:

Steve M. said...

Excellent info. Thanks. I will definitely use this when I create my GitHub account.

And you're right... the basics aren't usually covered by most other sites and blog posts. This will come in handy. Thanks.