OyaCode - Tips
type: channel
link: https://code.nfblogs.com/tag/Tips/
items: Basic usage of "git archive"

Basic usage of "git archive"
type: item
date: 2023-11-08T21:22:00+08:00
description: Sometimes we need to pack up our project as a compressed file such as an ZIP file. In the same time we only want to exactly ignored the file based on the .gitignore config. So here is where git archive command comes to the stage.The basic usage of git archive command is like below:git archive -o archive.zip HEADIn which:-o / --output Specified the output name-f / --format Specified the compressed file format, e.g.: tar, zipHEAD / [BRANCH_NAME] Specified the branch you want to archive