0
0
Gitdevops~15 mins

Feature branch workflow in Git - Mini Project: Build & Apply

Choose your learning style9 modes available
Feature Branch Workflow with Git
📖 Scenario: You are working on a team project using Git. Your team uses a feature branch workflow to keep the main branch stable. Each new feature is developed in its own branch and merged back only when ready.
🎯 Goal: Learn how to create a feature branch, make a commit, and merge it back into the main branch using Git commands.
📋 What You'll Learn
Create a new branch called feature-login from main
Make a commit with a message Implement login feature
Switch back to main branch
Merge the feature-login branch into main
💡 Why This Matters
🌍 Real World
Teams use feature branches to work on new features safely without breaking the main code. This keeps the project stable and organized.
💼 Career
Knowing how to use feature branches is essential for collaboration in software development jobs and DevOps roles.
Progress0 / 4 steps
1
Create a feature branch
Use the command git branch feature-login to create a new branch called feature-login from the current main branch.
Git
Need a hint?

Use git branch followed by the branch name to create a new branch.

2
Switch to the feature branch
Use the command git checkout feature-login to switch to the feature-login branch.
Git
Need a hint?

Use git checkout followed by the branch name to switch branches.

3
Make a commit on the feature branch
Use git commit -m "Implement login feature" to create a commit with the message Implement login feature on the feature-login branch.
Git
Need a hint?

Use git commit -m with your message in quotes to commit changes.

4
Switch back and merge the feature branch
First, switch back to the main branch using git checkout main. Then merge the feature-login branch into main using git merge feature-login.
Git
Need a hint?

Use git checkout main to switch back, then git merge feature-login to merge the feature branch.