Script Valley
Developer Environment Setup (WSL, Terminal, VS Code)
Git Workflows and Developer Best Practices/Assessment

Practice & Assessment

Test your understanding of Git Workflows and Developer Best Practices

Multiple Choice Questions

5
1

What is the correct order of commands to create a new feature branch, make a commit, and merge it back to main?

2

A developer committed a .env file with API keys. It is in the latest commit but not yet pushed. What is the correct fix?

3

What does git stash pop do?

4

What is the golden rule of git rebase?

5

What type prefix should a commit use when updating a dependency version in package.json without changing any application logic?

Coding Challenges

1
1

Git Workflow Simulation Script

Write a Bash script called git-practice.sh that sets up and demonstrates a complete Git workflow in a temporary directory. The script must: (1) create a temp directory and git init it, (2) create an initial README.md and commit on main with message chore: initial project setup, (3) create feature branch feature/add-config, add a config.json file, commit with feat(config): add default configuration, (4) switch back to main, add CHANGELOG.md, commit with docs: add changelog, (5) merge the feature branch into main, (6) print git log --oneline to show the result. Input: none. Output: a functioning git repository in /tmp/git-practice with a clean commit history. Time estimate: 20-25 minutes.

Easy

Mini Project

1

Team Development Workflow Simulator

Simulate a multi-developer Git workflow in WSL2. Create a script full-workflow.sh that: (1) initializes a bare remote repo in /tmp/remote-repo.git using git init --bare, (2) clones it twice into /tmp/dev-alice and /tmp/dev-bob to simulate two developers, (3) as alice creates feature/api-routes, adds routes.js, commits with a conventional commit message, pushes the branch, (4) as bob creates feature/middleware, adds middleware.js, commits, pushes, (5) as alice pulls main, merges feature/api-routes to main, pushes main, (6) as bob pulls main, rebases feature/middleware on top of updated main, merges to main, pushes, (7) generates a final git log --all --oneline --graph output. The project combines branching, merging, rebasing, push, pull, and conventional commits in one demonstration.

Hard
Practice & Assessment โ€” Git Workflows and Developer Best Practices โ€” Developer Environment Setup (WSL, Terminal, VS Code) โ€” Script Valley โ€” Script Valley