0
0
Gitdevops~10 mins

Creating a repository with git init - Try It Yourself

Choose your learning style9 modes available
Creating a repository with git init
📖 Scenario: You want to start a new project on your computer and keep track of all your changes using Git. This helps you save different versions of your work and share it with others later.
🎯 Goal: You will create a new folder for your project and turn it into a Git repository using the git init command. This sets up Git to track your files.
📋 What You'll Learn
Create a new directory called my_project
Navigate into the my_project directory
Initialize a Git repository inside my_project using git init
Verify the repository was created by checking the Git status
💡 Why This Matters
🌍 Real World
Developers use Git repositories to save and manage changes in their projects, making teamwork and version control easier.
💼 Career
Knowing how to initialize a Git repository is a fundamental skill for software developers, DevOps engineers, and anyone working with code.
Progress0 / 4 steps
1
Create a new directory called my_project
Type the command to create a new directory named my_project.
Git
Need a hint?

Use the mkdir command followed by the folder name.

2
Navigate into the my_project directory
Type the command to change your current directory to my_project.
Git
Need a hint?

Use the cd command followed by the folder name.

3
Initialize a Git repository inside my_project
Type the command git init to create a new Git repository in the current directory.
Git
Need a hint?

Simply type git init to start tracking your project with Git.

4
Check the Git repository status
Type the command git status to see the current state of your Git repository.
Git
Need a hint?

Use git status to see if Git is tracking your folder.