29 quizzes
Record staged changes with a clear message in an atomic commit
git commit - "Implement payment validation"Click an option to fill the blank:
Create a new feature branch from the current branch following a branching strategy
git feature/add-audit-loggingClick an option to fill the blank:
Stage only part of a file to keep a commit atomic
git add - src/auth/login.jsClick an option to fill the blank:
Define a local .gitignore entry to avoid committing environment files
echo ".env" >> .gitClick an option to fill the blank:
Configure Git to sign all commits for better security and auditability
git config --global commit.gpgsign Click an option to fill the blank:
Which commit message best follows Conventional Commits and explains the intent?
Why are atomic commits recommended for keeping history clean?
In a Git Flow-style workflow, which branch should contain production-ready code?
Which file is the best place to prevent committing API keys stored in a .env file?
After accidentally committing a password, what is the safest first action?
Order the steps to create a small, atomic commit for a single bug fix on main
Drag and drop to reorder, or use the arrows.
Order the steps to squash feature branch commits into one before merging to main
Drag and drop to reorder, or use the arrows.
Order the workflow to introduce a hotfix using a Git Flow-style branching strategy
Drag and drop to reorder, or use the arrows.
Order the steps to add a commit-msg hook that enforces Conventional Commit headers
Drag and drop to reorder, or use the arrows.
You are currently on branch feature/login. What will this command output?
1git branch --show-currentYour last commit message was "fix: handle null tokens". What will this command print?
1git log -1 --pretty=%sYou have an environment variable GIT_BRANCH_NAME set to "secure-deploy". What does this print?
1git config branch.current.nameIdentify the incorrect command in this attempt to create an atomic commit for a docs update
Click on the line(s) that contain the bug.
git checkout docs-updategit add docs/*.mdgit commit -m docs: update api usagegit push origin docs-updateFind the incorrect command in this workflow to rebase a feature branch onto main
Click on the line(s) that contain the bug.
git checkout maingit pull origin maingit rebase feature/logingit checkout feature/logingit rebase mainSpot the mistake in this attempt to ignore secrets and keep them out of history
Click on the line(s) that contain the bug.
echo "API_KEY=secret" > .envecho ".env" > .gitignoregit add .env .gitignoregit commit -m "chore: add local env file"GIT_TRACE_SECRETS=1 git commit -m "chore: enable secret tracing"Match each command or concept with its primary purpose in keeping history clean
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Match Conventional Commit types to typical use cases
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Match security-related Git practices with their purpose
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Complete the commands to create a feature branch and push it to origin following an atomic commit workflow
git checkout git checkout -b git push -u origin Click an option to fill blank 1:
Fill in the commands to configure a global .gitignore to avoid committing OS and editor files
git config --global ~/.gitignore_globalecho "*.swp" >> Click an option to fill blank 1:
Complete the commands to enable GPG signing and verify the latest commit
git config --global commit.gpgsign git log -1 Click an option to fill blank 1:
Click the line that shows the currently checked-out branch in this branch list
Click on the line to select.
main* develop feature/login hotfix/urgent-bugClick the part of git status output that shows an untracked secrets file that should be added to .gitignore
Click on the line to select.
On branch feature/paymentsUntracked files: (use "git add <file>..." to include in what will be committed) .env.local src/new-file.jsnothing added to commit but untracked files presentClick the line that indicates a commit introduces a breaking change according to Conventional Commits
Click on the line to select.
commit 2f3e9b1Author: Dev <dev@example.com>Date: Tue Jul 9 12:34:56 2024 +0000 feat(auth)!: switch to new token service