DEV Community

Aisalkyn Aidarova
Aisalkyn Aidarova

Posted on

Lab 1 Personal Portfolio Repository ⭐

Goal: Learn the complete Git workflow.

Task

  1. Create a GitHub account (if don't have one).
  2. Create a new repository called:
   my-first-repository
Enter fullscreen mode Exit fullscreen mode
  1. Clone it to their computer.
  2. Inside it create:
my-first-repository/
│
├── README.md
├── about.txt
└── hobbies.txt
Enter fullscreen mode Exit fullscreen mode

README.md

# My First GitHub Repository

Name:
Country:
Career Goal:
Enter fullscreen mode Exit fullscreen mode

about.txt

I am learning DevOps.
Enter fullscreen mode Exit fullscreen mode

hobbies.txt

Reading
Traveling
Sports
Enter fullscreen mode Exit fullscreen mode

Then execute:

git clone
cd my-first-repository

git status

git add .

git commit -m "Initial commit"

git push origin main
Enter fullscreen mode Exit fullscreen mode

Lab 2: Git Status

Give students these tasks.

Create

project/
Enter fullscreen mode Exit fullscreen mode

Inside:

notes.txt
commands.txt
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Then run

git log
Enter fullscreen mode Exit fullscreen mode

Questions

  • How many commits?
  • Which commit is newest?
  • Which command shows commit history?

Lab 4: Practice Repository

Students create

devops-lab
Enter fullscreen mode Exit fullscreen mode

Structure

devops-lab/

README.md

linux.txt

aws.txt

terraform.txt
Enter fullscreen mode Exit fullscreen mode

Each file contains

Linux commands

AWS services

Terraform definition
Enter fullscreen mode Exit fullscreen mode

Push everything to GitHub.


Lab 5: Clone Someone Else's Repository

Partner activity.

Student A

  • Creates repository
  • Pushes files

Student B

git clone
Enter fullscreen mode Exit fullscreen mode

Verify files exist.

This teaches GitHub collaboration.


Lab 6: Intentional Mistakes

Give them commands out of order.

Example

git commit -m "first"
Enter fullscreen mode Exit fullscreen mode

What happens?

Expected:

nothing to commit
Enter fullscreen mode Exit fullscreen mode

Then ask

"What command did you forget?"

Answer

git add .
Enter fullscreen mode Exit fullscreen mode

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)
Enter fullscreen mode Exit fullscreen mode

Answers

git clone
git status
git add .
git commit -m ""
git push origin main
Enter fullscreen mode Exit fullscreen mode

Lab 8: Final Practical Exam (30 minutes)

Students must create

student-project/

README.md
linux.txt
git.txt
aws.txt
Enter fullscreen mode Exit fullscreen mode

Requirements

  • Initialize Git.
  • Connect to GitHub.
  • Stage all files.
  • Commit with:
  Initial project
Enter fullscreen mode Exit fullscreen mode
  • 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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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)