Goal: Learn the complete Git workflow.
Task
- Create a GitHub account (if don't have one).
- Create a new repository called:
my-first-repository
- Clone it to their computer.
- Inside it create:
my-first-repository/
│
├── README.md
├── about.txt
└── hobbies.txt
README.md
# My First GitHub Repository
Name:
Country:
Career Goal:
about.txt
I am learning DevOps.
hobbies.txt
Reading
Traveling
Sports
Then execute:
git clone
cd my-first-repository
git status
git add .
git commit -m "Initial commit"
git push origin main
Lab 2: Git Status
Give students these tasks.
Create
project/
Inside:
notes.txt
commands.txt
Questions:
- Run
git status - Which files are untracked?
- Stage only
notes.txt - Check status again.
- Commit only that file.
- What happens to
commands.txt?
They learn
- Untracked
- Staged
- Committed
Lab 3: Git History
Students make 5 commits.
Commit 1
Create README
Commit 2
Add Linux commands
Commit 3
Add Git commands
Commit 4
Fix typo
Commit 5
Add contact info
Then run
git log
Questions
- How many commits?
- Which commit is newest?
- Which command shows commit history?
Lab 4: Practice Repository
Students create
devops-lab
Structure
devops-lab/
README.md
linux.txt
aws.txt
terraform.txt
Each file contains
Linux commands
AWS services
Terraform definition
Push everything to GitHub.
Lab 5: Clone Someone Else's Repository
Partner activity.
Student A
- Creates repository
- Pushes files
Student B
git clone
Verify files exist.
This teaches GitHub collaboration.
Lab 6: Intentional Mistakes
Give them commands out of order.
Example
git commit -m "first"
What happens?
Expected:
nothing to commit
Then ask
"What command did you forget?"
Answer
git add .
Lab 7: Fill in the Missing Commands
1. Create repository on GitHub.
2. _________
(download repository)
3. _________
(check current status)
4. _________
(stage all files)
5. _________
(save changes locally)
6. _________
(upload changes to GitHub)
Answers
git clone
git status
git add .
git commit -m ""
git push origin main
Lab 8: Final Practical Exam (30 minutes)
Students must create
student-project/
README.md
linux.txt
git.txt
aws.txt
Requirements
- Initialize Git.
- Connect to GitHub.
- Stage all files.
- Commit with:
Initial project
- Push to GitHub.
Commands they should use:
git init
git remote add origin
git status
git add .
git commit -m "Initial project"
git push -u origin main
Bonus Challenge
Ask students to modify README.md by adding:
- Their favorite Linux command
- Why they want to learn DevOps
- The date they completed the lab
Then they should:
git add README.md
git commit -m "Update README"
git push
This gives them experience making multiple commits to the same repository.
These labs cover the essential Git workflow:
- ✅ Creating a repository
- ✅ Cloning
- ✅ Checking status
- ✅ Staging files
- ✅ Committing changes
- ✅ Viewing history
- ✅ Pushing to GitHub
- ✅ Making additional commits
This is an appropriate foundation before introducing branching, merging, pull requests, and resolving merge conflicts.
Top comments (0)