When the work on a branch is done you bring it into the main branch. The rule is simple: move to the branch that is to receive the work, then merge the other branch into it. If you want it in main, you move to main first.
git switch maingit merge fix/logingit log --oneline --graph
main while you worked on the branch, Git makes nothing new; it slides the main label forward to the tip of the branch. This is a fast-forward, and the history stays a straight line.If both branches have moved on (each has commits the other lacks) a fast-forward is not possible. Git creates a new commit with two parents that joins the two tips: a merge commit. If the two branches touched different files, or different places in the same file, it sorts that out itself.