git push --dry-run origin main

Category: Git - Core

git push --dry-run origin main

Preview a push without sending it

Shows exactly which commits and refs would be pushed, then stops without transferring anything. Use it to sanity-check what an unpushed branch contains. The -n shorthand does the same.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.