Skip to content

Instantly share code, notes, and snippets.

@tkhk
Last active March 25, 2022 07:49
Show Gist options
  • Save tkhk/0190de250b5c64967cc042d32c377b12 to your computer and use it in GitHub Desktop.
Save tkhk/0190de250b5c64967cc042d32c377b12 to your computer and use it in GitHub Desktop.

git diff で差分があるかどうかだけ知りたい

$ git diff --exit-code --quiet
$ echo $?

--exit-code で差分があれば 1, なければ 0.

--quiet で何も表示しない.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment