Git Tutorial for Beginners



         Working Directory

Stores all the project files.

         Staging Area

Also called the index. Essentially a single ledger or manifest that acts like a set of instructions for all proposed changes to the repository.


Holds all the committed files.



Create a Github Repository

Create an account or sign in

Create a repo and upload your project files

Install Git

Launch Git

Let Git know who you are

git config --global "Your_User_Name_Here"
git config --global ""

Change Directory to the Desktop

cd desktop

Make a new folder for your working directory

mkdir 'github tutorial'

Go into the folder you just made

cd 'github tutorial'

Clone your remote repo

git clone{yourname}/{repository}

Create readme text file and edit in the vim editor

vim readme

Insert the file. Add some text. Save

i or Insert key         #Insert (enter document for editing)

Arrow keys              #Navigate document

ctrl+[                  #Escape document back into console

:q                      #Quit WITHOUT Saving

:x                      #Save and Quit

Now you can see all the untracked (new files) and unstaged files.

git status

Add all files to the staging area. Alternatively, you could specify the readme file in place of the period since it’s the only untracked file.

git add .

Always commit with a message in quotes

git commit -m "fixed transaction rounding errors"

The readme file is ready to be merged with the online github repo. “-u” saves branch configuration (origin master) and allows push and pull to work as expected. In the future Git now knows from where to push and pull.


git push -u

On branch master
Your branch is up-to-date with ‘origin/master’.
nothing to commit, working directory clean

git status

Check your github repo and you should see the readme file. Not too shabby.

Command Line Reference:



Leave a Reply

Fill in your details below or click an icon to log in: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

Create a website or blog at

Up ↑

%d bloggers like this: