0
0
Gitdevops~15 mins

git status to see current state - Mini Project: Build & Apply

Choose your learning style9 modes available
Using git status to see current state
📖 Scenario: You are working on a project and want to check what files have changed, which files are staged, and the current branch you are on.
🎯 Goal: Learn how to use the git status command to see the current state of your git repository.
📋 What You'll Learn
Have a git repository initialized
Make some changes to files
Use git status to check the current state
💡 Why This Matters
🌍 Real World
Developers use <code>git status</code> daily to understand what changes are staged, unstaged, or untracked before committing code.
💼 Career
Knowing how to check the git repository state is essential for version control and collaboration in software development jobs.
Progress0 / 4 steps
1
Initialize a git repository
Run the command git init to create a new git repository in your current folder.
Git
Need a hint?

This command sets up a new git repository in your current folder.

2
Create a new file and add some content
Create a file named example.txt and add the text Hello Git inside it.
Git
Need a hint?

You can use echo "Hello Git" > example.txt to create the file with content.

3
Check the current git status
Run the command git status to see the current state of your repository including untracked files.
Git
Need a hint?

This command shows which files are untracked, modified, or staged.

4
View the output of git status
Observe the output of git status which should show example.txt as an untracked file.
Git
Need a hint?

The output lists untracked files like example.txt under 'Untracked files:'