GIT-PATCH-ID(1) Git Manual GIT-PATCH-ID(1) (NAME) git-patch-id - (SYNOPSIS) git patch-id [--stable | --unstable | --verbatim] (DESCRIPTION) (patch ID) . << >> SHA-1 . << >> << >> . . git diff-tree --patch . . . (OPTIONS) --verbatim (whitespace) . --stable --unstable . patchid.verbatim true . --stable <<>> . : o . -O . o 1.9 <<>> ( --unstable ) - diff -O <<>> . o (whitespace) . patchid.stable true . --unstable <<>> . 1.9 . 1.9 ( ) . . (EXAMPLES) git-cherry(1) . . : #!/bin/sh upstream="$1" branch="$2" test -z "$branch" && branch=HEAD limit="$3" if test -n "$limit" then tail_opts="$limit".."$upstream" else since=$(git log --format=%aI "$upstream".."$branch" | tail -1) tail_opts=--since="$since"' '"$upstream" fi for_branch=$(mktemp) for_upstream=$(mktemp) git rev-list --no-merges "$upstream".."$branch" | git diff-tree --patch --stdin | git patch-id --stable | sort >"$for_branch" git rev-list --no-merges $tail_opts | git diff-tree --patch --stdin | git patch-id --stable | sort >"$for_upstream" join -a1 "$for_branch" "$for_upstream" | cut -d' ' -f2,3 rm "$for_branch" rm "$for_upstream" . (SEE ALSO) git-cherry(1) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-PATCH-ID(1)