I need to return the commit, but only if there are no conflicts. Something like git revert --only-if-no-conflicts, but there is no such option, and no --dry-run( --no-commitit will still affect the working copy, which I need to avoid).
In this case, the return is executed from the script, so I can not manually check whether there were conflicts or not. I can do it somehow from a script, but before diving into it, is there any clever way to make Git return only if it succeeds without conflict?
source
share