0
0
Gitdevops~30 mins

Why workflow agreement matters in Git - See It in Action

Choose your learning style9 modes available
Why Workflow Agreement Matters in Git
📖 Scenario: Imagine you and your friends are working together to write a story. If everyone writes their part in a different way, the story might get messy and confusing. In software projects, teams use Git workflows to keep things organized and clear.
🎯 Goal: Learn how to create a simple Git workflow agreement by setting up a shared branch and making commits in an agreed way. This helps everyone work smoothly without conflicts.
📋 What You'll Learn
Create a new Git repository
Create a branch called feature
Make a commit on the feature branch
Merge the feature branch into main following the agreed workflow
Display the commit history to confirm the workflow
💡 Why This Matters
🌍 Real World
Teams use Git workflows to coordinate work on software projects, making sure everyone knows where to add new features and how to combine changes safely.
💼 Career
Understanding Git workflows is essential for developers, testers, and DevOps engineers to collaborate effectively and maintain code quality.
Progress0 / 4 steps
1
Initialize Git repository and create main branch
Run git init to create a new Git repository and create a file called README.md with the text "Project Start". Then add and commit this file with the message "Initial commit on main".
Git
Need a hint?

Use git init to start the repository. Create the README.md file with echo. Then add and commit the file.

2
Create and switch to the feature branch
Create a new branch called feature using git branch feature and switch to it with git checkout feature.
Git
Need a hint?

Use git branch feature to create the branch and git checkout feature to switch to it.

3
Make a commit on the feature branch
On the feature branch, create a file called feature.txt with the text "New feature work". Add and commit this file with the message "Add feature work".
Git
Need a hint?

Create the file with echo, then add and commit it with the correct message.

4
Merge feature branch into main and show commit history
Switch back to the main branch with git checkout main. Merge the feature branch using git merge feature. Finally, show the commit history with git log --oneline.
Git
Need a hint?

Switch to main, merge feature, then use git log --oneline to see commits.