Skip to content

[Hands-On Discussion] T4L5/hp-reset-commits (Resetting to past commits) #107

@damithc

Description

@damithc

Lesson

https://nus-cs2103-ay2526s1.github.io/website/book/gitAndGithub/reset/

Hands-on setup

Responses to provide when running new.sh:

Hands-on name: hp-reset-commits
Requires Git? (defaults to y)  [y/N]: y
Requires Github? (defaults to y)  [y/N]: N

Repo folder name: things

Equivalent bash commands for creating the sandbox:

echo -e "apples\nbananas\ncherries\ndragon fruits" >> fruits.txt
git add fruits.txt
git commit -m "Add fruits.txt"

echo -e "elderberries\nfigs" >> fruits.txt 
git add fruits.txt  # stage the updated file
git commit -m "Add elderberries and figs into fruits.txt"

echo "a file for colours" >> colours.txt
echo "a file for shapes" >> shapes.txt
git add colours.txt shapes.txt
git commit -m "Add colours.txt, shapes.txt"
git tag 0.9

echo -e "apples, apricots\nbananas\nblueberries\ncherries\ndragon fruits\nfigs" > fruits.txt
git commit -am "Update fruits list"

echo "bad colour" >> colours.txt
git add colours.txt
git commit -m "Incorrectly update colours.txt"

echo "bad shape" >> shapes.txt
git add shapes.txt
git commit -m "Incorrectly update shapes.txt"

echo "bad fruit" >> fruits.txt
git add fruits.txt
git commit -m "Incorrectly update fruits.txt"

echo "bad line" >> incorrect.txt
git add incorrect.txt
git commit -m "Add incorrect.txt"

echo "another bad colour" >> colours.txt
git add colours.txt

echo "another bad shape" >> shapes.txt

Instructions for students

Run gitmastery download hp-reset-commits to create a fresh sandbox.

Requires remote repository?

No

Additional remarks

N/A

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions