Git: identify potential merge / redirect conflict

Is there an easy way to detect a potential merge / redirect conflict between two branches using the git command? For example, some files are changed in two branches, or some files are deleted from one branch and are available in another branch. What I can imagine is to find a common ancestor of the two branches with the team

git merge-base

and then list the entire file modification status from a common ancestor to the head of both branches, and then compare the list of states to find out a potential merge point. Is this right or is something smarter? If so, how to do it?

Many thanks.

+4
source share
1 answer

SO, , , git merge --no-commit. . , , .

. , , :

git merge-tree `git merge-base branch1 branch2` branch1 branch2 \
  | grep -A3 "changed in both"
+4

All Articles