Rabi Siddique
172 words
1 minutes
What is Diverged Branch in Git?
2024-08-05

What are Branches in Git?#

In Git, branches are like different versions or paths of your project that you can work on separately. Think of them as different timelines where you can experiment, develop features, or fix bugs without affecting the main version of the project, which is usually kept in the main or master branch.

What Does It Mean for Branches to Diverge?#

When we say that branches have diverged, it means that two branches have started from the same point but have had different commits added to them over time, leading them to develop in different directions. This is like two paths in a forest that start from the same spot but split and lead to different places.

                  [Common Ancestor Commit]
                        /               \
              [Commit A]                 [Commit D]
                  |                         |
              [Commit B]                 [Commit E]

The Common Ancestor Commit is where both branches last shared the same content. After this point, one branch has commits A and B, while the other has commits D and E. These different commits represent the divergence in the branches.

What is Diverged Branch in Git?
https://rabisiddique.com/posts/diverged-branches/
Author
Rabi Siddique
Published at
2024-08-05