Creating and cloning a new Github repo with VSCode

flora marina petersen
2 min readJul 18, 2021

Every time I want to start a new project, I have the same thought: “uh-oh, how do I set up a new Github repo?” And off to Google I go. After doing this so many times, you would think it would become second nature. Apparently not! I’m going to put together a handy little guide for people like myself, who forget every time. Or, if I’m being honest, maybe this is just for myself to refer back to!

Now, of course, if you don’t have a Github account, that’s your first step. That part is easy, just go to github.com and get yourself set up! You can install Git for your desktop if you’d like, though I typically just use it via web browser and that’s worked just fine so far.

From the dropdown at the top right corner, hit “Your Repositories”. From here you’ll be able to click on the green “New” button to create a new repository. Give it a name, and a README (not necessary but a good thing to have).

Now that you have a repository set up, you can clone it in Visual Study Code (VSCode). On the homepage of VSCode you will see the option to create a new project or clone a repository. Choose the clone repository option and put in your repository’s URL. This URL will be found on your repository’s page on Github. Hit the green “Code” button and simply copy the URL. After pasting that URL into VSCode, it will open up your project.

You’ll want to make an initial commit. In the VSCode terminal, type the following:

git add .
git ci -m "initial commit"
git push

This will push an initial commit to the main branch of your repository. From here you can make all the commits you want! Hurray!

--

--