I\'m trying to script rebasing and my script will take different paths depending on if the rebase results in any conflicts.
Is there a way to determine if a rebase w
I suspect that git rebase ... --dry-run is not possible, for the following reason.
When you're doing a git rebase, git will rollback to the starting point, then incrementally apply patches for each commit to bring the branch up to date. If it hits a conflict, it will stop & wait for you to resolve the conflict before continuing. The path that the rebase takes after that conflict depends upon how you resolve the conflict - if you resolve it a certain way, that might introduce (or eliminate) later conflicts.
Thus, git rebase ... --dry-run would only be able to give you the first conflict - reports of later conflicts will depend upon how that first conflict is resolved.
The only way I can think of doing this would be via git diff between the current position and the last commit in the branch you're rebasing to. But that won't really give you what you're looking for - you really just need a list of conflicting changes between the two points. There might be a way to do it with git diff, but it's not a normal patch.