xxxxxxxxxx
git checkout master # master is checked out
git pull # update local
git merge new-feature # merge branch new-feature into master
git push # changes on remote. Then checkout a feature branch
xxxxxxxxxx
# from current working branch
git checkout master
git merge <my-branch-name>
# resolve conflicts if any
git add .
# no commit message required
git commit
git push origin master
xxxxxxxxxx
# Fast Forward Merge
# Start a new feature
git checkout -b new-feature main
# Edit some files
git add <file>
git commit -m "Start a feature"
# Edit some files
git add <file>
git commit -m "Finish a feature"
# Merge in the new-feature branch
git checkout main
git merge new-feature
git branch -d new-feature
xxxxxxxxxx
$ git checkout master
Switched to branch 'master'
$ git merge <your brach name>
xxxxxxxxxx
Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch. This command is used by git pull to incorporate changes from another repository and can be used by hand to merge changes from one branch into another.
xxxxxxxxxx
Merging combines changes from one branch into another,
typically integrating changes made in a feature branch into the main branch.