Kickstart Your GitHub Journey With These Easy Steps
Tags: github, javascript, beginners, tutorial
Published: 2021-10-14 00:02:07

# What is GitHub?

GitHub is a we-based platform used for project version control and code hosting.

GitHub uses Git, a widely-used version control system.

GitLab and Bitbucket are also similar tools. 

## Requirements

Before we start the tutorial here are some of the prerequisites:

1. Very basic knowledge of Git
2. Git installed in your system
3. A GitHub account

With a ready GitHub account, we can now begin.

# Getting Started

To keep things really simple, you can use one of your projects, if none you can create a simple HTML page.

For the rest of the tutorial, we will be using the Terminal to run commands. 

To kickstart, in the terminal navigate to your project root directory.

# Initialize Git

In order to store our locally created file/folder to GitHub,  the first step is to initialize Git.

Run:

```html
git init
```

Running this command turns your directory into a new Git Repository.

# Addition of Files

This process is known as staging

In staging we mark the repository so that we can track any changes made to our local folder since the last commit.

Run:

```html
git add .
```

All the files in the repository will be marked, ignoring the `.gitignore` file.

# Committing files

We are now ready for our first commit on our already marked files.

A commit is a snapshot of the current state of the files, it will prepare the tracked changes for pushing to GitHub.

Run:

```html
git commit -m "Add any message"
```

The commit message is just a friendly reminder about what changes are in the commit.

# Pushing to GitHub

There are two parts of this process.

First and foremost we need to create a repository, here is where we push our local commits to the remote repository.

The last part is pushing our project

## Create your first repository

Log into your GitHub account, at the top right corner, click the plus sign icon then select ***New Repository***.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/garblavllujkpi4hcslv.png)
Follow the instructions and ***Create Repository.***
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w0n31m5aoxaagh6pdoh6.png)
Take note of the created repository name.

Stay on the ***Create Repository*** page to finish the next step***.***

## Pushing your project to GitHub

On the Create Repository page, navigate to "push an existing repository from the command line" section, copy the three commands provided and paste them in your terminal, press enter to execute them.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ac1mia3z6oijssqow3fu.png)

```html
git remote add origin <link>
git branch -M main
git push -u origin main
```

After running these commands, you can reload the browser page to see the changes.

Your project is now listed in the online repository.

If this is your first one, congratulations! You have reached a programming milestone.

## Making Updates to the Repository

You can make updates to the online repository by running the following commands.

```html
git add .
git commit -m "Commit message"
git push -u
```

Replace the message with a descriptive of your own.

Happy Coding!!!!!