Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Stashing

Create a disposable repository with one committed tracked file. Make one staged change and one separate unstaged change, then create a stash with `--keep-index`. Verify that the staged change remains staged and the other change is no longer present in the working tree. Next, create an untracked file and use `--include-untracked` to stash it. Finally, create an ignored file and use `--all` to stash it. Record the exact `git status --short` state before and after each operation, and explain which option caused each file class to be included or excluded.

Intermediate ~6 min read

Challenge 1

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

bash Your answer
git  --short

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to create the repository.

bash Your answer
git  --initial-branch=main

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to read or set Git configuration.

bash Your answer
git  user.name "Foxipa Git Test"

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to read or set Git configuration.

bash Your answer
git  user.email "git-test@example.invalid"

Press Ctrl⌘Enter to check your answer