devops/activities/10-git-homework.md
2026-01-01 00:00:00 +00:00

85 lines
3.7 KiB
Markdown

---
id: act-10-git-homework
title: Git Homework
mode: homework
open_at: 2026-02-01T00:00:00+01:00
close_at: 2026-12-31T23:59:59+01:00
retakes_enabled: true
max_attempts: 999
grade_max: 100
---
## T1
Type: essay
Points: 20
Prompt: Compare merge and rebase as integration strategies and explain how they differ in the history they produce (use the terminology from the materials).
Refs:
- mat-07-git#merge-versus-rebase
- mat-07-git#basic-rebasing-workflow
Rubric:
- Correctly describes merge as combining endpoints and potentially creating a merge commit (8)
- Correctly describes rebase as replaying commits onto a new base and changing commit history (8)
- Discusses when a cleaner linear history is desired versus keeping merge structure (4)
## T2
Type: single_choice
Points: 10
Prompt: Which statement best describes git fetch as presented in the materials? A) It fetches from a remote and immediately merges into your current branch B) It downloads remote data without merging it into your current work C) It deletes remote branches that are missing locally D) It creates an annotated tag
Refs:
- mat-07-git#fetching-and-pulling
## T3
Type: file
Points: 20
Prompt: Create file @solutions/act-01-git-homework/t3-rebase.txt containing commands+output for a rebase exercise: create a topic branch with commits, make at least one new commit on the base branch, then rebase the topic branch onto the base branch and show git log --oneline --decorate --graph --all before and after.
Refs:
- mat-07-git#basic-rebasing-workflow
- mat-07-git#divergent-history-and-viewing-the-graph
Rubric:
- Shows topic branch commits and a separate base-branch commit before rebasing (8)
- Shows rebase command(s) and successful completion (8)
- Includes before-and-after graph outputs (3)
- Commands and outputs are clearly labeled (1)
## T4
Type: multiple_choice
Points: 10
Prompt: Select ALL correct statements about fetch/pull/push and tracking branches based on the materials. A) git pull fetches and then merges into your current branch B) git fetch downloads data but does not merge it into your current branch C) git push -u origin <branch> sets the upstream tracking relationship D) git fetch is the same as git pull
Refs:
- mat-07-git#fetching-and-pulling
- mat-07-git#pushing
- mat-07-git#tracking-branches-upstream
## T5
Type: file
Points: 15
Prompt: Create file @solutions/act-01-git-homework/t5-tags.txt containing commands+output for: creating an annotated tag (git tag -a v1.4 -m "my version 1.4" or similar) and showing it with git show <tag>.
Refs:
- mat-07-git#lightweight-and-annotated-tags
- mat-07-git#listing-and-showing-tags
Rubric:
- Shows creation of an annotated tag with a message (6)
- Shows git show output for the tag (6)
- Commands and outputs are clearly labeled (3)
## T6
Type: single_choice
Points: 10
Prompt: According to the materials, what happens when you git checkout a tag name? A) Git creates a new branch with that tag name automatically B) Git switches you into a detached HEAD state C) Git deletes the tag after checkout D) Git pushes the tag to origin
Refs:
- mat-07-git#checking-out-tags-and-detached-head
## T7
Type: file
Points: 15
Prompt: Create file @solutions/act-01-git-homework/t7-aliases.txt containing commands+output for: defining alias.unstage and alias.last using git config --global, verifying them via git config --list (or git config alias.unstage/alias.last), and running at least one of the aliases in a repository.
Refs:
- mat-07-git#git-aliases
- mat-07-git#unstaging-files
- mat-07-git#viewing-history-with-git-log
Rubric:
- Shows alias definitions using git config --global (6)
- Shows verification of aliases in config output (4)
- Demonstrates executing an alias and shows its output (4)
- Commands and outputs are clearly labeled (1)