This is the first section of our course. We will cover the basic usage of GitHub’s web interface and some commands for local usage of Git.

Creating an account

Given that I had previous experience with GitHub, I already had an account:

1.1Account

But don’t worry, the sign-up is really straight forward.

Creating a new repository in GitHub

To create a new repository, go to your GitHub home page (the cat at the top left corner) and click on “New Repository”:

1.2NewRepo

Creating a local repository in your computer

To create a local repository, use the following command inside the folder where you want to create the repository:

git init

1.3LocalRepo

Cloning a repository from GitHub

To clone a repository from GitHub to your computer, go the Repository page and copy the HTTPS link, then enter the following command:

git clone <HTTPS link>

1.4Clone1

Adding or deleting a file to your local repository

Now lets add a file to our local repository.

First, use any kind of editor to create a new file (code, plain text or something). I created a file named “plain.txt”. To add it to the repository use:

git add plain.txt

To verify that the file was succesfully added, use the following command:

git status

1.5AddLocal

If you want to remove the file use:

git rm plain.txt

You can also use the git status command to verify the deletion:

1.6RemoveLocal

GitHub's web interface

Now let’s play a little with GitHub’s web interface.

Adding a file

To add a file to the repository from the the web interface, click on the ‘+’ sign next to the name of the repository as shown in the image:

1.8CreateFileWeb

Then select a name for the file, put some content in it, and click on the ‘Commit’ button.

Editing a file

You can modify the content of the file by clicking on it, and then click on the pencil icon as shown in the images:

1.7EditWeb1

And:

1.7EditWeb2

Deleting a file

To delete a file from the web interface, select it and click on the trash icon:

1.9DeleteWeb1

And commit changes:

1.9DeleteWeb2

That’s it! Our Noob Section from the course has ended. Continue with next post Basic Section.