LinuxCommandLibrary

git-get-tar-commit-id

Extract commit ID from tar archive

TLDR

Extract commit ID from archive

$ git get-tar-commit-id < [archive.tar]
copy

SYNOPSIS

git get-tar-commit-id < archive

DESCRIPTION

git get-tar-commit-id extracts the commit ID from a tar archive created by git archive. The commit ID is stored in the archive's pax extended header when the archive was generated.
This command reads from stdin and outputs the 40-character SHA-1 hash if found. It is particularly useful for build systems that distribute archives and need to verify source versions. The command only works with archives created by git archive, as standard tar archives do not contain git metadata.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community