Version Control | Git & GitHub

Version Control | Git & GitHub

17/09/2026

Version Control is essential in any development, whether it's a small pet project or a serious enterprise project. VS Code provides convenient access to Git and GitHub tools.

To create a local repository (Git), press "Source Control" in the side panel and choose "Initialize Repository".

You will see all the project files waiting to be committed (saved):

I don't need most of them. Most of these files are installed packages that take up too much space, and I will be able to install them again at any time. So, I don't really need to save them. This job is handled by the "package.json" and "package-lock.json" files.

There is a specific file to specify which files you don't want to save, so Git will ignore them. It's called ".gitignore". Create it manually and write file names, their extensions, or folder names in it.

node_modules
.env


I wrote the "node_modules" folder here, which I explained before, and also the ".env" file. We don't have an ".env" file right now, but we will in the future, because we need a place to store sensitive and confidential data (e.g. passwords), and we don't want anyone to see it.

After this, there are only 3 files left in the "Source Control" panel, instead of 603.

The next important but not mandatory file is "README.md". It's a description of the project, and anyone visiting our repository will see this on its main page. You can also create it manually if you want and write how you would describe your creation.

When everything is ready for committing, press "Stage All Changes" (the "+" button), so you can choose every new available file to save.

Write a message describing what you have done. Then press "Commit". You will see your commit in the "Graph" section.

To publish your project to GitHub, first of all, create an account on GitHub and connect it to VS Code.

Press the "Publish Branch" button. I chose "Publish to GitHub public repository" because I want to show this project to anyone.

It automatically created the online repository on GitHub:

Links:

1. GitHub: https://github.com

2. My repository: https://github.com/sichendev/Sichen