
First of all, I just started to learn git.
I want to merge the red branch into the others, but there is no merge button.
In fact, essentially, I don't know why they are seperated.


First of all, I just started to learn git.
I want to merge the red branch into the others, but there is no merge button.
In fact, essentially, I don't know why they are seperated.

Copyright © 2021 Jogjafile Inc.
git statuscommand. If you are not on the branch you want to merge into (i.e. receiving branch), switch to that branch usinggit switch [branchname]eg.git switch maingit merge [branchname]eg.git merge featureAIn your case, the red branch is
orphan branch, that's why it is separate. In short, orphan branch doesn't share the same ancestor as other branches. You can google for more detailed information. To merge orphan branch, you should add the following flag--allow-unrelated-historiesto git merge command. eg.git merge featureA --allow-unrelated-historiesAbove steps merge the branch named
featureAintomainbranchHere is a good article if you want to learn more about merging.
Note:
A. before merging make sure all the changes are committed.
B. beware Merge conflict may arise. In that case this article might help