# GitHub 101: Uploading Files to a New Repository via Command Line

So at this point I assume you should know *How to create a Repository,* If you don't do checkout my previous  [article here](https://bmonish.hashnode.dev/github-101-creating-a-new-repository-in-github).

Let's dive in and add files via the Command Line.

1. Follow the steps 1, 2 and 3 from my  [previous article!](https://bmonish.hashnode.dev/github-101-creating-a-new-repository-in-github) 

2. Once done, You should see a screen like this.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619949018203/pdRrHwyxQ.png)

3. Assuming you have a folder created in your local machine, Open the terminal and redirect to the project directory. (I have three files with boilerplate code)
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619949199040/2jVJRMaIR.png)

4. Run the following command to *Initialize* the repository.

    ```git init
    ``` 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619949300204/F-Ifzmdo3.png)

5. Now you have to let your machine know which remote repository you're planning to work on. To do that copy the ```git remote add origin <url>``` line from the 3rd step and execute it.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619949432509/4clBgyhoH.png)

6. To add all files run ```git add .``` or you can add only a specific file by executing ```git add index.html``` The former will add files to the changing area and the later will add only the *index.html* file.

7. After running the commands, If you want to check the status of your working directory execute ```git status```
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619949624327/hryE_Jdxs.png) It will give you an overview of the changes that are tracked and has been added to the stage.

8. Now, to create a commit execute ```git commit -m"<Desc. of your commit>"```

9. Finally push your changes by executing ```git push origin <branch name>```
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619949999566/1RSayqN6c.png)

10. You should now see your files in the repository!
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619950078663/kZyVw8dFW.png)
_________________________

*Feel free to drop your suggestions in the comments and if you find it useful give me a like and share it with someone who might benefit from it.*

*Reach out to me on my Instagram  [@monish.codes](https://www.instagram.com/monish.codes/) If you have any queries or just want to have a conversation! See you on the flip side.*

