Do all git commands have the -dry-run option, or does one of them indicate what the command could do without executing them?
Not every team will naturally maintain a dry run directly.
git merge --no-commit --no-ff
git fetch origin
git log master..origin/master
git merge origin/master
git push
How JC Hamano summarizes :
There are things that are not implemented in git because they do not make sense, and there are things that are not implemented in git because no one had an itch to scratch.In other words, we strive to realize only things that are real, demonstrated needs from the real world and only when the addition makes sense as a coherent part of the system.
iboisver comments:
Another thing you need to know about is commands like git add and git rm that allow you to use the -n command line option to specify a dry run , and in git commit , the -n option means something completely different.So be sure to check the man page
git add
git rm
-n
git commit
git commit -n :
git commit -n
-n --no-verify
This option bypasses the pre-commit and commit-msg hooks. See also githooks (5) .
Although the --dry-run flag is not always available for each comment, equivalents usually exist. For example, this previous question shows what to do for git merge .
--dry-run
git merge