111 lines
5.1 KiB
Markdown
111 lines
5.1 KiB
Markdown
---
|
|
id: act-08-git-understanding
|
|
title: Git Understanding
|
|
mode: understanding
|
|
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: single_choice
|
|
Points: 10
|
|
Prompt: Which option is NOT listed as a benefit of using source control in the lecture materials? A) Tracking changes over time B) Collaborative work on the same codebase C) Encrypting all source code automatically D) Reverting to previous versions
|
|
Refs:
|
|
- mat-07-git#why-version-control
|
|
|
|
## T2
|
|
Type: multiple_choice
|
|
Points: 10
|
|
Prompt: Select ALL statements that match Git as described in the materials. A) Git works like a stream of snapshots, not deltas B) Git is centralized and requires the server for nearly every operation C) Cloning gives you a full copy of nearly all data/history by default D) Git supports branching and merging for parallel development
|
|
Refs:
|
|
- mat-07-git#types-of-version-control-systems
|
|
- mat-07-git#git-overview
|
|
- mat-07-git#snapshots-not-deltas
|
|
- mat-07-git#cloning-a-repository-with-git-clone
|
|
|
|
## T3
|
|
Type: essay
|
|
Points: 15
|
|
Prompt: Explain the roles of the working directory, staging area, and git directory, and relate them to the three file states (modified, staged, committed).
|
|
Refs:
|
|
- mat-07-git#working-directory-staging-area-git-directory
|
|
- mat-07-git#file-states-modified-staged-committed
|
|
Rubric:
|
|
- Correctly defines working directory, staging area, and git directory (.git) and their roles (6)
|
|
- Correctly explains modified, staged, committed and how files move between states (6)
|
|
- Uses correct Git terminology and connects states to areas clearly (3)
|
|
|
|
## T4
|
|
Type: file
|
|
Points: 10
|
|
Prompt: Create file @solutions/act-01-git-understanding/t4-version-and-config.txt containing the commands you ran and terminal output for: git --version, git config --global user.name, git config --global user.email, and git config --list.
|
|
Refs:
|
|
- mat-07-git#installing-git-and-verifying
|
|
- mat-07-git#first-time-setup-with-git-config
|
|
Rubric:
|
|
- Includes git --version command and its output (3)
|
|
- Includes user.name and user.email queries (or setting + query) with output (4)
|
|
- Includes git config --list output (2)
|
|
- Output is readable and clearly separated by command (1)
|
|
|
|
## T5
|
|
Type: file
|
|
Points: 15
|
|
Prompt: Create file @solutions/act-01-git-understanding/t5-init-add-commit.txt containing the commands you ran and terminal output while you: git init a new repo, create README.md, git status, git add README.md, git status -s, git commit -m "Initial commit", and finally git log --oneline.
|
|
Refs:
|
|
- mat-07-git#getting-a-repository-with-git-init
|
|
- mat-07-git#checking-status-with-git-status
|
|
- mat-07-git#staging-with-git-add
|
|
- mat-07-git#short-status-format
|
|
- mat-07-git#committing-with-git-commit
|
|
- mat-07-git#viewing-history-with-git-log
|
|
Rubric:
|
|
- Shows repository initialization (git init) and at least one commit (4)
|
|
- Includes both git status and git status -s outputs at meaningful points (4)
|
|
- Demonstrates staging with git add and committing with git commit -m (4)
|
|
- Includes git log --oneline output showing the commit (2)
|
|
- Commands and outputs are clearly labeled (1)
|
|
|
|
## T6
|
|
Type: multiple_choice
|
|
Points: 10
|
|
Prompt: In git status -s output, which interpretations are correct? Select ALL that apply. A) 'M file.txt' means the file is modified and staged B) ' M file.txt' means the file is modified but not staged C) '?? file.txt' means the file is ignored by .gitignore D) 'AM file.txt' means the file was added to staging and then modified again
|
|
Refs:
|
|
- mat-07-git#short-status-format
|
|
|
|
## T7
|
|
Type: single_choice
|
|
Points: 10
|
|
Prompt: Which command shows what you have staged that will go into your next commit (compared to the last commit)? A) git diff B) git diff --staged C) git status -s D) git log --oneline
|
|
Refs:
|
|
- mat-07-git#viewing-changes-with-git-diff
|
|
|
|
## T8
|
|
Type: essay
|
|
Points: 10
|
|
Prompt: Describe how .gitignore patterns work (including at least one use of '!' negation) and give a small example .gitignore for ignoring build/ and *.log but keeping keep.log tracked.
|
|
Refs:
|
|
- mat-07-git#ignoring-files-with-gitignore
|
|
Rubric:
|
|
- Correctly describes how patterns are matched (glob-style) and that comments/blank lines are handled (4)
|
|
- Correctly explains negation with '!' and uses it appropriately (3)
|
|
- Provides an example .gitignore that matches the requested behavior (3)
|
|
|
|
## T9
|
|
Type: file
|
|
Points: 10
|
|
Prompt: Create file @solutions/act-01-git-understanding/t9-undo.txt containing commands and output for: (1) make a commit with a wrong message then fix it with git commit --amend, (2) stage a file then unstage it using git reset HEAD <file> or git restore --staged <file>, (3) modify a tracked file then discard the modification using git checkout -- <file> or git restore <file>.
|
|
Refs:
|
|
- mat-07-git#amending-the-last-commit
|
|
- mat-07-git#unstaging-files
|
|
- mat-07-git#discarding-local-modifications
|
|
- mat-07-git#restore-versus-reset-and-safety
|
|
Rubric:
|
|
- Shows a commit being amended (commands + output/log evidence) (4)
|
|
- Demonstrates unstaging a staged file (commands + output) (3)
|
|
- Demonstrates discarding a modification safely (commands + output) (2)
|
|
- Commands and outputs are clearly labeled (1)
|