#!/usr/bin/bash

# Create new git repository
git init --initial-branch=master mergeRecursive
cd mergeRecursive

# Commit on master branch
echo "A1" > A1.txt; git add A1.txt; git commit -m "A1"

# Commits on branch B
git switch -c B
echo "B1" > B1.txt; git add B1.txt; git commit -m "B1"
echo "B2" > B2.txt; git add B2.txt; git commit -m "B2"
echo "B3" > B3.txt; git add B3.txt; git commit -m "B3"

# Switch to master branch
git switch master

# New commit on master branch
echo "A2" > A2.txt; git add A2.txt; git commit -m "A2"

# Merge branch B 
git merge -m "Merge branch 'B'" B

# Review graph
git log --all --graph --decorate

