Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Foundations: Working Tree, Index, and Commits

In a new disposable directory, reproduce the workflow without copying the lesson’s exact command sequence. Your final repository must contain one commit on `main`, and that commit must contain a file named `notes.txt` whose contents are `Git state matters.` followed by a newline. Before committing, use a status or diff command to verify what is staged. After committing, use `git log` or `git show` to verify the resulting history.

Beginner ~6 min read

Challenge 1

Complete the Git command to inspect commit history.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to inspect a snapshot or object.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to create the repository.

bash Your answer
git  -b main

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to record working-tree and index state.

bash Your answer
git  --short

Press Ctrl⌘Enter to check your answer