0
0
Gitdevops~15 mins

What is Git - Hands-On Activity

Choose your learning style9 modes available
What is Git
📖 Scenario: You are starting a new project and want to keep track of your changes safely. Git helps you save different versions of your work so you can go back if needed.
🎯 Goal: Learn the basics of Git by creating a new Git repository, adding a file, and committing the changes.
📋 What You'll Learn
Create a new Git repository
Add a file to the repository
Commit the file with a message
Check the commit history
💡 Why This Matters
🌍 Real World
Developers use Git to keep track of changes in their code projects, so they never lose work and can collaborate easily.
💼 Career
Knowing Git is essential for software development jobs, as it is the most popular tool for version control and teamwork.
Progress0 / 4 steps
1
Initialize a Git repository
Type git init in your project folder to create a new Git repository.
Git
Need a hint?

Use git init to start tracking your project with Git.

2
Create a file and add it to Git
Create a file named README.md with some text and then type git add README.md to add it to Git.
Git
Need a hint?

Use echo "text" > README.md to create the file and git add README.md to stage it.

3
Commit the changes
Type git commit -m "Initial commit" to save your changes with a message.
Git
Need a hint?

Use git commit -m "message" to save your staged changes with a note.

4
View the commit history
Type git log to see the list of commits you have made.
Git
Need a hint?

Use git log to check your commit history and see your saved changes.