← 返回命令列表

Linux command

git-get-tar-commit-id 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Extract commit ID from archive

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

说明

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.

FAQ

What is the git-get-tar-commit-id command used for?

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.

How do I run a basic git-get-tar-commit-id example?

Run `git get-tar-commit-id < [archive.tar]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.