Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Latest commit

 

History

History
20 lines (14 loc) · 726 Bytes

git-merge-dry-run.org

File metadata and controls

20 lines (14 loc) · 726 Bytes

Git Merge “dry run”

  • Time-stamp: <2020-03-23 05:05:14 tamara>
  • published date: 2018-02-28 10:30
  • keywords: git, merge, dry run, tools

There’s no specific thing called a “dry run merge” with git, but it’s simple enough to simulate.

In the sample below, BRANCH is being merged into TARGET.

git checkout $TARGET
git merge --no-commit --no-ff --no-edit $BRANCH
git diff --cached
git merge --abort

You can look for any potential merge conflicts after the first command as well and see what you might be up against.

Note you need both the --no-commit AND --no-ff flags to prevent the merge from occurring if it’s possible for a fast-forward merge to occur (likely).