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 (in AWS CodeCommit this is called Squash and Merge)
Linear history with only a single commit on the target
Deleting the source branch when squashing is recommended
git merge pr --squash

Rebase (in AWS CodeCommit this is called Fast Forward Merge)
Linear history with all commits rebased onto the target
git rebase master
git merge pr --ff-only
Semi-linear merge (in AWS CodeCommit this is called 3-way Merge)
Rebase source commits onto target and create a two-parent merge
git rebase master
git merge pr --no-ff

For more info: