09 - Student Worksheet (Fill-in + Exercises)
#09 - Student Worksheet (Fill-in + Exercises)
Name: ________ Date: ________ Batch: ________
##Part A - Core Concepts
Fill in the blanks.
- Git command used to check current state: ________
- Area where selected changes are kept before commit: ________
- Command that records staged changes into history: ________
- Command to see unstaged line-by-line changes: ________
- File used to ignore temporary files: ________
Short answers.
- Explain untracked file in one sentence:
- Explain difference between working directory and staging area:
##Part B - Command Practice
Create your practice directory and initialize git.
1
2
3
4
mkdir git_worksheet
cd git_worksheet
touch a_file
git init
Task 1: Initial commit
Write the commands you used:
1
Task 2: Add first line to a_file and commit
Write the commands you used:
1
Task 3: Add second line to a_file and view history
Write the commands you used:
1
##Part C - Mistake Recovery
Scenario 1: You staged b_file and c_file, but only b_file should be committed.
Write the unstage command for c_file:
1
Scenario 2: You accidentally committed c_file. You want to go back to previous correct commit but keep changes available.
- Command to move HEAD to previous correct commit while keeping changes staged:
1
- Command to unstage c_file:
1
##Part D - Remote Workflow
Fill in commands.
- Add remote named origin:
1
git remote add origin ____________________
- Push and set upstream for main:
1
____________________
- Download latest remote references without merging:
1
____________________
- Pull latest changes:
1
____________________
##Part E - vi Practice
Open file in vi:
1
vi notes.txt
Complete this checklist.
- Enter insert mode using key: ________
- Return to normal mode using key: ________
- Save command: ________
- Save and quit command: ________
- Quit without saving command: ________
- Delete current line command: ________
- Undo command: ________
- Search command format: ________
##Part F - Mini Challenge (Instructor Check)
Perform all tasks and ask trainer to verify.
- Create a repository.
- Make 2 commits to same file.
- Add .gitignore and ignore one temp file.
- Stage wrong file and unstage correctly.
- Open vi, add one line, save and quit.
Trainer signature: ________
##Reflection
- The command I found most useful today:
- The command I need to practice more:
- One real project scenario where Git history helps: