# GitHub -Push from local to remote (Step-by-step)

This post is intended for everyone learning Git and GitHub for the first time, and asking how to push your project from your local machine to GitHub.

I will assume I am talking to myself while doing this tutorial, so follow along and talk to your self as well. 😁

**Step 1:**
I will create a new folder on my local machine called "*push_to_github*" with two files inside "*index.html*" and "*app.js*" and some simple code in both of them.

![Screenshot (2).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1584535208876/tTf57FUZz.png)

**Step 2:**
I will create a new repository on  [github](https://github.com/) named "*push_to_github*", and click create without checking any other options.

![Create a New Repository.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1584535507081/F_D1YQ4xR.png)

**Step 3:**
I will right-click on my "*push_to_github*" on my **Desktop** and click on **Git Bash Here**

![Screenshot  (3).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1584535805741/QoH_wNhVp.png)

**Step 4:**
On my git bash, I will do the following:

```git
git init
git add
git commit -m "First commit"
```
![Screenshot  4 .png](https://cdn.hashnode.com/res/hashnode/image/upload/v1584536369454/glH49PuqU.png)

In the above code snippet, I initialized my folder with git, then added every file on track and finally committed them.

**Step 5:**
Next is to go back to my GitHub (the repo we created early) and copy the URL of my repo which looks like this (https://github.com/vincentiroleh/push_to_github) and back to my git bash I will execute the following commands:

```git
git remote add origin https://github.com/vincentiroleh/push_to_github
git push origin master
```

If you encountered an error: 
`fatal: protocol 'https' is not supported`

To resolve this, execute this command below:
```git
 git remote set-url origin https://github.com/vincentiroleh/push_to_github
```
Then try:
```git
git push origin master
```
In the above code snippet, I connected the remote repo to track the local one, and then pushed my changes to the remote repo.

If the https error occurred while doing that, we set our url again, and everything works just fine.

**Thank you**

I hope I helped you solved a problem, do share and comment if you need my assistance.
💕




