Command whose exit code indicates clean or dirty working directory
- From
- Ross Goldberg <ross.goldberg@proton.me>
- Date
- Apr 10, 2025, 17:49 UTC
- Message-ID
- <jreR52go49E9pIfAmIdRaoqIgKnVV7uOhR4Mbl9_p2dLG_7mPgO8qsUk7CaWC0nGbJD-2F4nGdQ8X65UtIQ5XOBNQXXzrnHnKbOCLCfEil0=@proton.me>
What is the simplest git command that returns 0 if the working directory is completely clean, or nonzero if it is dirty in any way (staged diff, unstaged diff, file that is both untracked & not ignored, etc.), with nothing printed to stdout or to stderr? If the simplest such command is complex, is there any feature request to create a simple command, possibly with options that specify what is considered dirty (staged diffs, unstaged diffs, untracked & not ignored, etc.)?
Sent from Proton Mail for iOS