Git & VS Code

Install Git and VS Code

Written by oxypteros

What is Git

Imagine you’re co-writing an important document, like a big report or a story.
You save it as first-chapter.doc, then send it to a colleague. It comes back as first-chapter-edits.doc, then you resend it as first-chapter-final.doc, but you get it back like first-chapter-REALLY-final.doc and the back and forth keeps happening.
Before long, you’re buried in confusing file names, unsure which version is the latest, what changed, or who made which edits.

That’s where Git comes in. Instead of juggling multiple versions, Git keeps a clean, detailed history of your project. It tracks every change, who made it, and allows you to go back to any previous version whenever needed, without the chaos of endless file copies.

What is VS Code

Visual Studio Code (VS Code) is a text editor, not a word processor like Microsoft Word or Google Docs. Those are WYSIWYG (What You See Is What You Get) editors. Meaning what you see on your screen is exactly how the final document will appear.

However, for our purpose, we need a text editor where the text remains plain, because Hugo and Alpha will handle the styling and formatting. To keep the process simple, from writing content to publishing it as a webpage, we also need an editor that integrates well with Git and GitHub.

That’s where VS Code comes in. It’s the perfect tool for writing and managing your website’s content and it integrates well with both Git/Github and Hugo.

Choose your OS


Install on Windows

Both installations are straightforward.

Install Git

  1. Visit the official Git website and download the latest Windows version.
  2. Double-click the downloaded file and keep all the default options as they are.

Once the installation is complete, open PowerShell 7 and verify the installation by running:

git --version

If you see the Git version displayed, we can proceed to configuring Git.

Configure Git
  • Set your email, ideally the same one you used for your GitHub account. Replace [email protected] with your actual email (keep the quotes).
git config --global user.email  "[email protected]"
  • Set your username. Replace Your Name with your actual name or GitHub username (keep the quotes):
git config --global user.name  "Your Name"
  • Change the default branch from “master” to “main” for compatibility:
git config --global init.defaultBranch main
  • Set VS Code as the default Git editor:
git config --global core.editor "code --wait"

Now Git is properly installed and configured and we can proceed with the VS Code installation

Install VS Code

  1. Visit the official VS Code website and download the Windows version.
  2. Double-click the downloaded file and keep all the default options as they are.

Install on Linux

We will use your distribution’s package manager to install Git.

Install Git

sudo apt install git # For Debian/Ubuntu/Mint and derivatives
sudo dnf install git # For Fedora/Rocky/AlmaLinux and RHEL derivatives
sudo pacman -S git # For Arch/Manjaro 
sudo zypper install git # For openSUSE 

Adjust the command based on your package manager and whether you need to use sudo.

Once the installation is complete, we can proceed with configuring Git.

Configure Git
  • Set your email, ideally the same one you used for your GitHub account. Replace [email protected] with your actual email (keep the quotes).
git config --global user.email  "[email protected]"
  • Set your username. Replace Your Name with your actual name or GitHub username (keep the quotes):
git config --global user.name  "Your Name"
  • Change the default branch from “master” to “main” for compatibility:
git config --global init.defaultBranch main
  • Set VS Code as the default Git editor:
git config --global core.editor "code --wait"

Now Git is installed and configured. Let’s install VS Code.

Install VS Code

Although some package managers include VS Code, I prefer the official package.

  1. Visit the official VS Code installation page for Linux.
  2. Locate your Linux distribution and follow the provided installation steps

I would advise against installing VS Code via Snap or Flatpak, as these versions tend to be less stable and may occasionally cause unexpected issues compared to the official package.

Install on Chromebook

If you’ve been following this guide step by step, you should already have the Linux development environment enabled.

Now, open the Terminal app and follow the same installation steps for Git and VS Code as outlined in the Install on Linux section (For Debian).