Clone this repository and you'll find three branches to work with:
ex1/start- Exercise 1 starting pointex2/start- Exercise 2 starting pointex3/start- Exercise 3 starting point
For each exercise, checkout the corresponding branch and follow the instructions.
Goal: Practice a standard feature branch workflow.
Starting branch: ex1/start
You're working on a new button component. Complete these steps:
- Create a new branch called
feature/add-buttonfromex1/start - Make changes to
stuff/button.js:- Change the button text from "Click me" to "Submit"
- Add a new className:
btn-primary
- Stage and commit your changes with message: "update button component"
- Merge your feature branch into
main
Success criteria: Your changes are on main
If you get stuck:
git statusis your friend - run it oftengit log --oneline --graph --allshows you the full picture- You can always reset to the starting branch:
git reset --hard ex1/start(or ex2/start, ex3/start)
Common commands you'll need:
git branch <name> # Create branch
git switch <name> # Switch branch
git add <file> # Stage changes
git commit -m "message" # Commit changes
git merge <branch> # Merge branch
git reset # Undo commits
git log # View history