As part of my journey into DevOps engineering, I've been working on understanding how developers collaborate using Git and GitHub.
One important concept I've been practicing is Git branching and merging .
In a real development environment, multiple developers can work on the same application simultaneously. Rather than everyone modifying the main branch directly, developers work on separate branches and eventually integrate their changes.
Here's what I learned.
1. Why do we use Git branches?
Imagine a team with three developers:
Developer A is working on new features.
Developer B is fixing bugs.
Developer C is implementing updates.
Instead of everyone working directly on the main branch, each developer can work independently.
For example:
git branch development git branch patches git branch updates
Enter fullscreen mode
Exit fullscreen mode
Switch between branches using:
git checkout development
Enter fullscreen mode
Exit fullscreen mode
This allows developers to work on different parts of…