Foundations

Your First Repository

~15 min

Your First Repository

Time to get hands-on! In this lesson, you'll create your first Git repository. Use the Terminal below to run commands, and watch how it affects the VS Code view.

Steps

1

Initialize a Git Repository

Every Git project starts with initialization. This creates a hidden .git folder that stores all your project's history.

Type the following command in the terminal:

git init

This command creates a new Git repository in your current folder.

In VS Code:

  • Open the Source Control panel (branch icon in sidebar)
  • Click "Initialize Repository"
2

Create Some Files

Now let's create some files to track. In a real project, these would be your code files.

3

Check the Status

Git status shows you what's happening in your repository. It's the command you'll use most often!

💻 Terminal

Terminal — /
Welcome! Type "help" for available commands.
Try: git init
$

📝 VS Code

Explorer
No files yet.
Click + to create a file.

Select a file to edit

💡 Tips

  • Use the up arrow in the terminal to repeat previous commands
  • Type help to see all available commands
  • The VS Code view updates automatically when you run commands
  • Try clear to clear the terminal