0
0
Gitdevops~10 mins

git commit with message - Mini Project: Build & Apply

Choose your learning style9 modes available
git commit with message
📖 Scenario: You are working on a small project and have made changes to a file. Now, you want to save these changes in your Git repository with a clear message explaining what you did.
🎯 Goal: Learn how to create a Git commit with a descriptive message to save your changes in the repository.
📋 What You'll Learn
Create a new file called example.txt with some text
Add the file to the Git staging area
Commit the changes with a message Initial commit with example.txt
Display the commit log to verify the commit
💡 Why This Matters
🌍 Real World
Saving changes with clear messages helps teams understand what was done and why, making collaboration easier.
💼 Career
Knowing how to commit with messages is a basic but essential skill for any developer or DevOps engineer working with version control.
Progress0 / 4 steps
1
Create a new file called example.txt with text
Create a file named example.txt and add the text Hello, Git! inside it.
Git
Need a hint?

You can use the echo command to write text into a file.

2
Add example.txt to the Git staging area
Use the Git command to add the file example.txt to the staging area.
Git
Need a hint?

Use git add example.txt to stage the file.

3
Commit the changes with a message
Create a Git commit with the message Initial commit with example.txt.
Git
Need a hint?

Use git commit -m "your message" to commit with a message.

4
Display the commit log to verify
Use the Git command to show the commit log and verify your commit message appears.
Git
Need a hint?

Use git log --oneline to see a short commit history.