This repository is a teaching example for learning the GitHub workflow:
- Fork → Clone → Branch → Implement → Pull Request → Code Review → Revise → Merge.
The app is a very simple console-based Todo list in Java.
- Add task (with title + description)
- List tasks
- Mark task DONE by id
- Remove task by id
- Fork this repo on GitHub (click Fork).
- Clone your fork:
git clone https://github.com/<your-username>/oss-todo-collab.git cd oss-todo-collab
- (Optional) Add the ST-ITM organizations’ repo as
upstream:git remote add upstream https://github.com/ST-ITM/oss-todo-collab.git git remote -v
git checkout -b feature/remove-task-
TodoList.java- Implement
remove(int id)so it removes the task and returnstrueif found,falseotherwise.
- Implement
-
TodoApp.java- Add a new menu option:
4) Remove by id - Shift Quit to
5) Quit - Add a new method
removeTask()that:- Reads the id
- Calls
todoList.remove(id) - Prints
[INFO] Removed.or[ERROR] Not found.
- Add a new menu option:
-
Compile & run locally
javac *.java java Main- Add two tasks
- List tasks
- Mark one DONE
- Remove one by id
git add .
git commit -m "feat: remove task by id"git push -u origin feature/remove-task- On GitHub, click Compare & pull request
- Fill PR description:
- What changed
- How to test
- (Optional) Link to issue
As a reviewer:
- Open Files changed
- Add specific comments (not just “good job”)
- Examples:
- “Consider handling non-numeric input in
removeTask()like inmarkDone().” - “You return immediately after removing; this prevents index skipping. Good!”
- “Consider handling non-numeric input in
Make edits → commit with clear message → push:
git commit -am "fix: consistent error handling in removeTask"
git pushMaintainer merges.
After that, the forked repository can be synced. First checkout the main branch,
then pulling the changes in the upstream (now updated after the PR was merged), and finally pushing to the origin (the forked repository).
git checkout main
git pull upstream main
git push origin main- Practice branching and PR workflow
- Learn to give constructive code review comments
- Experience revising code in response to feedback