Skip to content

Commit 8f9e8e3

Browse files
committed
Tweak git hooks demo
1 parent 8e4068e commit 8f9e8e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

demo-notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Run the demos in VS Code for the combined view of the file contents and the term
3535
2. Run `tree .git/hooks` and discuss output.
3636
3. Run `less .git/hooks/pre-commit.sample` and discuss output.
3737
4. Create a version of the file that will get run: `cp .git/hooks/pre-commit.sample .git/hooks/pre-commit`.
38-
5. Edit the `.git/hooks/pre-commit` file to have `exit 1` near the top (automatic failure).
39-
6. Attempt to commit the slides PDF to this branch. Discuss why it failed.
38+
5. Edit the `.git/hooks/pre-commit` file to have `echo "Read-only -- no commits allowed"; exit 1;` near the top (automatic failure).
39+
6. Attempt to commit the slides PDF to this branch and then run `git status`. Discuss why it failed.
4040
7. Run `rm .git/hooks/pre-commit` to get rid of the automatic failure hook.
4141
8. Attempt the commit again. Discuss why it succeeds.
4242
9. Push the changes up so the PDF version of the slides is available for everyone.

0 commit comments

Comments
 (0)