# Creating a Repository on GitHub through Visual Studio Code

I added my first GitHub repository using the CLI, but this time I tried adding a repository through VS code. This method was surprisingly easy and for newbies like me these are the steps.

Step 1:

Open your code in visual studio code, go to the source control.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705599719925/15fb1b2b-3184-4fa7-b026-7159bfd4ef41.png align="center")

To create a new repository, if you don't already have one created, select "Initialize Repository". However, if you already have a reposiory on GitHub you can choose the second option "Publish to GitHub".

For this blog I will be focusing on the "Initialize Repository" option.

Step 2:

The next window you will see is the "Commit" window. Here it will show you all the file you have not commited yet, and you can choose a select few or commit all. You should also input a message for your commit.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705600005363/98e11fd1-599c-462a-bf1b-15917f6c905e.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705600181509/c59ded53-5dd9-471b-ab4f-2f97ca1d8ae7.png align="center")

As I have only one to commit I just continued and was issued this message, I selected yes but if you intend to always commit all your changes select always.

Step 3:

You will be asked to provide access to your GitHub profile for VS code, this will bring you to a window for you to authorize this access.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705601221475/6f3b5a96-f427-4064-af9e-108613b77628.png align="center")

A pop up for GitHub login will then appear and you must log in for VS code verification.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705601263463/60ca6daa-d47c-468d-9f64-23649c38328e.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705601245858/77bfe628-d53e-495d-aa5f-ec7f2a3520b1.png align="center")

Step 4:

You will next see a window to "Publish Branch", this pushes your code to GitHub and

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705601411739/1ae321ba-e8a4-49ef-aa1b-ee291f05288f.png align="center")

I got a notification to say this was successfully published.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705600691203/fc4d47af-e7e2-4152-bbf1-b26dc10cd2b8.png align="center")

This is a more straightforward method, if you don't like using the CLI this is the way to go.
