Is there a Git command that can be used to determine if a merge is in-process (i.e. uncommitted)? I know I can simply check for .git/MERGE_HEAD, but is this pr
Since MERGE_HEAD is only available during a merge and is also future-proof, we can simply use git rev-list -1 MERGE_HEAD (conveniently, a plumbing command) which will exit with code 128 if MERGE_HEAD is not found. Pipe stdout and stderr to /dev/null for a cleaner check. Or even better, use git rev-parse -q --verify MERGE_HEAD.