Difficulty: Beginner
Estimated Time: 10 minutes

In this scenario you'll learn how to initialise a new Git repository and commit files into version control.

Version control allows you to record changes to a file or set of files over time enabling you to go back to a specific version if required. Git is a Distributed Version Control System (DVCS). This means that instead of having a snapshot of the latest files, you have a complete mirror of the repository on your local machine. The repository keeps track of the changes, when they occurred and who by. Having the complete repository on your local machine reduces delays due to network traffic and enables you to continue working when disconnected.

This scenario has explained how you can initialise a repository and then commit files to it. In the next scenario we'll investigate how to compare and commit changes to these files. In future scenarios we'll cover how to share these changes with other people.

Committing Git Files

Step 1 of 5

Git Init

To store a directory under version control you need to create a repository. With Git you initialize a repository in the top-level directory for a project.

After initialising a repository, a new hidden subdirectory called .git is created. This subdirectory contains the metadata that Git uses to store it's information. If you're interested in the details then use the command line to explore the contents.


As this is a new project, a new repository needs to be created. Use the git init command to create a repository.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

This tab will not be visible to users.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]