flatbubba
12/11/2017 - 4:43 AM

Git Merges

Check to see if any branches have already been FULLY MERGED into the current branch, e.g. MASTER

> git branch --merged
  colors
* master

This tells us that COLORS has been fully merged into MASTER and can be deleted. Switch to MASTER first!

>git branch -d colors
Deleted branch colors (was 1f03a75)

CHECK SHAHS OF MASTER AND BRANCH
>git logg master
>git logg colors

FAST-FORWARD MERGE:
A merge from a branch to a MASTER that HAS NOT had any changes to it since work started on the branch. I.e the MASTER stayed AS IS while we switched to and started working on the branch. Now we want to merge those changes back into MASTER. This should be an easy merge with no conflicts.
A FF merge DOES NOT register a COMMIT. It just moves the pointer to the newest SHAH of branch and now both the branch and MASTER point to this SHAH. No COMMIT is needed.
MERGE only if a fast-forward merge is possible:
>git merge --ff-only colors

If you want to force a COMMIT so it creates a record of the merge you can:
>git merge --no-ff colors

TRUE MERGE
A true merge happens when commits have occurred on the branch AND on master separately. Conflicts may or may not occur depending on what the changes are in each of the separate commits.