Git Init & Status

Create a repository and check its state.

✍️ 2 exercises in this lesson

git init turns a folder into a Git repository by creating a hidden .git folder.

git status shows which files are:

  • Untracked: new files Git is not tracking yet.
  • Modified: changed since the last commit.
  • Staged: ready to be committed.

Key Takeaways: Git Init & Status

Mastering Git Init & Status helps you write clean and reliable Git code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.

Git Init & Status Code Example

Git
mkdir my-project
cd my-project
git init
echo "# My Project" > README.md
git status
Output
Initialized empty Git repository in C:/my-project/.git/
On branch main

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        README.md
Run this example on your own computer. The "Get Started" lesson shows how to set it up.

Git Init & Status Practice Exercises

Check what you learned in “Git Init & Status”.

/ 2 solved
Fill in the blank

Turn the current folder into a Git repository.

git 
✓ Correct! Not quite. Try again.
Multiple choice

Which command shows untracked and modified files?

✓ Correct! Not quite. Try again.
to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

Stuck on something?

Ask the community in the CodesInTech forum.

Need a developer?

Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.

Explore Our Services