A Git Check for Missing Commits From a Remote

I recently add a pre-flight check to a devops project to ensure that all commits from the Git repository’s origin/master
are present locally. This is to guard against developers accidentally reverting others’ deployed changes.