🥽Virtual Lab: Git Flow
This content is a draft and will not be included in production builds.

Virtual Lab: Git Flow
Section titled “Virtual Lab: Git Flow”This virtual lab lets you run the four most common Git commands and watch what they actually do. There is one file, hello.txt, and you move it through four stages:
- Working Directory — where you edit files on your computer.
- Staging Area — a holding area for changes you’ve marked as ready to commit.
- Local Repo — your personal commit history (
HEADpoints to the newest commit). - Remote Repo — the shared copy on a server, e.g. GitHub.
What the commands do:
- Edit
hello.txtin the text area. The file card turns modified. git addcopies the working-directory version of the file into the staging area.git committype a message, then click this command. The staged version is recorded as a new commit on the local repo.git pushuploads local commits to the remote.git pulldownloads remote commits to the local repo. There is a simulated remote developer to make this realistic.
Try this sequence: (1) Edit hello.txt with some text. (2) git add → git commit (with a message) → git push. (3) Click 👥 Teammate pushes to simulate someone else committing to the remote. (4) Use git pull to bring their changes down to your local repo, and (5) Edit the file again, commit, and try git push before pulling and you’ll see the real “Push rejected — pull first” error. Run git pull, then push again.
Git Workflow Lab
Click commands to move hello.txt through the four stages and watch how add, commit, push and pull actually behave.
Some notes on the operation of this component:
- This is a simulation, so it is not perfect, as there are a lot of combinations!
- Buttons grey out when there’s nothing to do (e.g.,
git addwhen nothing has changed). Hover for the reason. - The What happened panel narrates every command in plain English. Read it after each click.
- The dots near the bottom show whether your local or remote is ahead.
- Click ↻ Reset to start over.
Knowledge Check
Section titled “Knowledge Check”Match the Four Stages of Git
Which command moves changes from the Working Directory into the Staging Area?
What is the result of running 'git commit'?
When would you see a 'Push rejected — pull first' error?
Which command downloads new work from a teammate on the Remote Repo into your Local Repo?
© 2026 Derek Molloy, Dublin City University. All rights reserved.