About
Merge is a git merge tool that is designed to integrate changes from one branch into another branch
It joins two or more branch together (ie development histories)
- The pull command is a wrapper that calls also the merge command.
- rebase is also designed to integrate changes to get an easier commit log: See What is the difference between a merge and a rebase?
Example
Imagine this commit history (log) with a remote and a local branch where the commit in the remote branch will be integrated into the local branch.
- A - B - C - D - remote HEAD
\
E - F - G - local HEAD
After a merge, the commit history (log) will look like:
- A - B - C - D - remote HEAD
\ \
E - F - G - local HEAD - new local HEAD
Management
Merge from master to the feature branch
git checkout feature
git merge master
# or in one liner
git merge master feature
Merge from a fork
See Upstream merge
git-cherry-pick
git-cherry-pick is the low-level merge command.