git merge
The git merge command combines changes from one branch into another branch and creates a new "merge commit" that represents the merge. Step 1: Initialize project
git init
Step 2: create index.html file and 2 commit m1,m2 add text "m1" into index.html and commit as m1

echo "m1" > index.html
git add .
git commit -m "m1" 
add text "m2" into index.html and commit as m2

echo "m2" >> index.html
git add .
git commit -m "m2" 
Step 3: create feature branch and checkout
git checkout -b feature
Step 4: create feature folder&file create feature.html into the feature folder and add text "f1" then commit as f1

echo "f1" >> feature/feature.html
git add .
git commit -m "f1" 
Step 5: Checkout to master
git checkout master
Step 6: add text "m3" into index.html and commit as m3

echo "m3" >> index.html
git add .
git commit -m "m3" 
Step 7: Checkout to feature
git checkout feature
Step 8: add text "f2" into feature.html and commit as f2

echo "f1" >> feature/feature.html
git add .
git commit -m "f2" 
Step 9: Checkout to master
git checkout master
Step 10: Merge the feature branch into master
git merge feature
as the result, we will get a new commit
 Merge branch 'feature'  
by Luka Tatarishvili
12 months ago
Git
0
Pro tip: use ```triple backticks around text``` to write in code fences