kind of hate merge like it makes the git log -p look pretty messed up
I might be dumb though
usually I do something like
checkout branch2
rebase -i branch1
# fix conflict
git checkout branch1
git merge branch2
and the history looks BEAUTIFUL
but with merge the process is (?)
# 1) Create a base repository with an initial file
# 2) Two feature branches make changes to the same file
# A) replace 1+4 with new text, add 8th line at end
# B) Replace 4 with new text, make line7 the last line
# 3) the feature2 dev fucks off so the feature1 dev resumes the work by merging
# feature2 into feature1
# 4) the git log looks kind of fucked up now
# SETUP
mkdir gittest
cd gittest
git init -b master
echo "Dumb file title" >> gittestfile
echo "subtitle" >> gittestfile
echo "" >> gittestfile
echo line1 >> gittestfile
echo "" >> gittestfile
echo line2 >> gittestfile
echo line3 >> gittestfile
echo line4 >> gittestfile
echo -e "\n\n" >> gittestfile
echo line5 >> gittestfile
echo line6 >> gittestfile
echo line7 >> gittestfile
git add gittestfile
git commit -m "initial commit"
# MAKE FEATURE 1
git checkout -b branch1
sed -i "s/line1/new_line1/g" gittestfile
sed -i "s/line4/new_line4/g" gittestfile
echo "remove_this_lane_later" >> gittestfile
git add gittestfile
git commit -m "feature_1"
# MAKE FEATURE 2
git checkout master
git checkout -b branch2
sed -i "s/line4/better_line4/g" gittestfile
sed -i "s/line7/this_is_the_last_line/g" gittestfile
git add gittestfile
git commit -m "feature_2"
# MERGE FEATURE 2 INTO FEATURE 1
git checkout branch1
git merge branch2
# FIX CONFLICT SO FILE LOOKS LIKE SCREENSHOT
#
# Then run:
#
# git merge --cintinue
# git log -p