Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Archive

Create a disposable repository with at least three commits and a release tag. Add a development-only directory and a release metadata file, then use `.gitattributes` with `export-ignore` and `export-subst`. Produce a tar archive from the release tag with a versioned `--prefix`, and produce a second archive containing only one selected path. Extract both into clean directories. Verify that the ignored path is absent, that the substituted metadata contains the expected commit ID, and that `git get-tar-commit-id` returns the commit recorded for the tag archive. Finally, compare that ID with `git rev-parse <tag>^{}`. Do not use `--worktree-attributes` unless you intentionally demonstrate its effect.

Intermediate ~6 min read

Challenge 1

Complete the Git command to create the archive.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to create the archive.

bash Your answer
git  <tree-ish>

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to create the archive.

bash Your answer
git  --format=tar HEAD > source.tar

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to create the archive.

bash Your answer
git  --format=tar release-2.0 > release-2.0.tar

Press Ctrl⌘Enter to check your answer