Tutorial by Examples

git merge incomingBranch This merges the branch incomingBranch into the branch you are currently in. For example, if you are currently in master, then incomingBranch will be merged into master. Merging can create conflicts in some cases. If this happens, you will see the message Automatic merge ...
When the commits on two branches don't conflict, Git can automatically merge them: ~/Stack Overflow(branch:master) » git merge another_branch Auto-merging file_a Merge made by the 'recursive' strategy. file_a | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
After starting a merge, you might want to stop the merge and return everything to its pre-merge state. Use --abort: git merge --abort
During a merge, you can pass --ours or --theirs to git checkout to take all changes for a file from one side or the other of a merge. $ git checkout --ours -- file1.txt # Use our version of file1, delete all their changes $ git checkout --theirs -- file2.txt # Use their version of file2, delete ...
Default behaviour is when the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. Use --no-ff to resolve. git merge <branch_name> --no-ff -m "<commit message>"
Sometimes you might have branches lying around that have already had their changes merged into master. This finds all branches that are not master that have no unique commits as compared to master. This is very useful for finding branches that were not deleted after the PR was merged into master. ...

Page 1 of 1