A Guide to Git & GitHub

In this course we will be learning about version control especially Git and GitHub which provides hosting for Git version control.

Git repository

We now have Git installed and set up to start working, it's now time to start working on project and using Git. For the exercises onward we will be working on a hypothetical university management system.

Create an empty directory named “university” in your user directory or any other location of your choice.

$ mkdir university
$ cd university

Create a file named index.html with below contents.

“<p>Welcome to the university</p>”

on linux you can do this with a single command

$ echo "<p>Welcome to the university</p>" > index.html

Git Repository

You can initialise a git repository in two ways:

  1. Initialise an existing local directory that is not under Git version control, and turn it into a Git repository.
  2. Retrieve an existing Git repository from a hosted location via URL

Initialise an existing local directory as Git repository

$ git init

You should see

Initialized empty Git repository in /home/user/university/.git/

Congratulations, you have your first local Git repository to build something amazing.
Previous Next

Unlock Your Potential with Engineeous

Get Started