LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

SEE ALSO

RESOURCES

Copied to clipboard
Kai