← 返回命令列表

Linux command

git-archive-file 命令

文件

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

常用示例

Create archive of current branch

git archive-file

说明

git archive-file is a git-extras utility that exports the current HEAD of the repository into a zip archive with a descriptive filename. The generated filename includes the repository name and branch name (e.g., "project.main.zip"), or on a detached HEAD such as a tag, uses the tag name (e.g., "project.1.0.0.zip"). The command takes no arguments or options. It always archives the current HEAD and writes the zip file to the current directory. As of git-extras 6.4, the assumed default branch name changed from master to main.

FAQ

What is the git-archive-file command used for?

git archive-file is a git-extras utility that exports the current HEAD of the repository into a zip archive with a descriptive filename. The generated filename includes the repository name and branch name (e.g., "project.main.zip"), or on a detached HEAD such as a tag, uses the tag name (e.g., "project.1.0.0.zip"). The command takes no arguments or options. It always archives the current HEAD and writes the zip file to the current directory. As of git-extras 6.4, the assumed default branch name changed from master to main.

How do I run a basic git-archive-file example?

Run `git archive-file` in a terminal, then adjust file names, paths, flags, or remote targets for your system.