Is there some kind of ‘git rebase –dry-run’, which would notify me of conflicts in advance?

At the time of writing this (Git v2.6.1 v2.10.0), the git rebase command offers no --dry-run option. There is no way of knowing, before actually attempting a rebase, whether or not you’re going to run into conflicts.

However, if you run git rebase and hit a conflict, the process will stop and exit with a nonzero status. What you could do is check the exit status of the rebase operation, and, if it is nonzero, run git rebase --abort to cancel the rebase:

git rebase ... || git rebase --abort

And if the rebase is successful but you realise that you want to undo it, you can run

git reset --hard ORIG_HEAD

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)