

When you click on Publish to GitHub, VSCode will ask you what name you want your new repo to have (defaults to the name of the root folder of your project) and you can choose whether you want your new repo to be private or public. This will do for you the repo initialization as well, but will also create a new repo in GitHub and push the code to it. If you want to have your repo in GitHub, instead, use Publish to GitHub. The first option does only execute the git init command, so it does technically create a repository for you but only on the local machine. Just click on the Git - Source Control iconĪnd this will prompt you to either Initialize Repository or Publish to GitHub Now that we know we are logged in, creating the repository in GitHub is very easy. If it is not like this, click on Sign In (GitHub) and you are good to go. Of course with your username, not mine 😇

The only thing you need to make sure to do before hand is logging in into VSCode with your GitHub user. let's just continue :)Įverything you need to create a new repository in GitHub from VSCode is already present in Visual Studio Code itself. But what if you don’t? Let’s do it now.Īs usual, if you are a visual learner, or simply prefer to watch and listen instead of reading, here you have the video with the whole explanation and demo, which to be fair is much more complete than this post. That content assumed you already had your code on GitHub. I already have an article and a video talking about how to use VSCode with GitHub, but, as someone has pointed out:

Do you have some code in VSCode and want to take it to GitHub, without having to write a single command in the CLI? Today I’m gonna show you how to do that, how to publish your code to a new GitHub repo, all from VSCode.
