Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git ls-tree: Inspect Tree Objects

In a disposable repository, create files in at least two directory levels and commit them. Use `git ls-tree` to inspect the root, then use `-r`, `-r -t`, `-d`, a path argument, `--name-only`, `--object-only`, `-l`, `--abbrev=12`, `-z`, and a custom `--format`. Run at least one inspection from inside a subdirectory and compare `--full-name` with `--full-tree`. Finally, pipe the non-recursive tree listing into `git mktree` and confirm that inspection and construction are separate operations.

Advanced ~6 min read

Challenge 1

Complete the Git command to inspect a tree object.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to inspect a tree object.

bash Your answer
git  HEAD

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to inspect a tree object.

bash Your answer
git  -r HEAD

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to inspect a tree object.

bash Your answer
git  -r -t HEAD

Press Ctrl⌘Enter to check your answer