For the record, there is git merge-tree
that can tell you on cmdline if two commits aka. branches aka. pull requests conflict without touching index or working tree:
$> git merge-tree 9e451918b3bb56f857c6f6df5d527092c02b2b3a b246935
60633013298d0dc97cde3738a378228b24e2b065
100644 88c2893ef8df18fd38034deab08cfee24dfb26fe 2 file1
100644 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 3 file1
Auto-merging file1
CONFLICT (add/add): Merge conflict in file1
Of course you have to have both fetched.
The Github API seems not be too responsive on this question. A PR can tell if it has merge conflicts with base branch. Also two commits can be compared, but that tells you only the diff or patch, but not if it has a conflict. There seems to be no API to evaluate if two pulls or branches or commits would conflict, although Github certainly has all required information in its db. I didn't try, but I assume that when you get the patch infos from github you can run patch --dry-run
to see if this conflicts.
git push
is going to do? – Mockheroic