I am currently using JGit to merge remote branches, so after fetching from remote I would like to verify conflicts before I attempt to merge, so that I can decide what kind of merge strategy to use, for eg:
Myrepo/filesmodifiedbyme/file1.txt
Myrepo/filesmodifiedbysomeone/file2.txt
After fetch:
- if there are conflicts in
file1.txt
, I would like to useMergeStrategy.OURS
, - if
file2.txt
has conflicts, I would like to applyMergeStrategy.THEIRS
.
So following are my questions:
- how to get conflicts ahead before merging two branches?
- how to apply multiple merge strategy on different files at same time?