set -xe # merge 1 # # merge 2 # # commit 1 (from M2) (date before C2) # # commit 2 (from M1) # # ------ # 2005-04-07T22:13:13 git checkout -b branch-1 mkdir -p src echo "Hello" > src/file-1 git add src/file-1 git commit --date="2022-11-16T13:00:00" -m "Add file 1" git checkout master git checkout -b branch-2 mkdir -p src echo "world" > src/file-2 git add src/file-2 git commit --date="2022-11-16T12:00:00" -m "Add file 2" echo "!!!" > src/file-3 git add src/file-3 git commit --date="2022-11-16T12:30:00" -m "Add file 3" git checkout master git merge branch-1 --no-ff -m "merge branch-1" sleep 2 git merge branch-2 --no-ff -m "merge branch-2" # merge 2 # merge 1 # branch 2 # branch 1