Thursday, May 23, 2019

Merge options provided by Visual Studio DevOps

I really like how Visual Studio (devOps) shows a visual hint for each type of merge that can be done via its interface. Here they are:
Merge (no fast forward)
Nonlinear history preserving all commits
git merge pr

where “pr” is the name of the branch.
Squash Commit
Linear history with only a single commit on the target
Deleting the source branch when squashing is recommended
git merge pr --squash

Linear history with all commits rebased onto the target
git rebase master
git merge pr --ff-only
Semi-linear merge
Rebase source commits onto target and create a two-parent merge
git rebase master
git merge pr --no-ff

For more info: