Recall & Review
beginner
What is a
post-merge hook in Git?A
post-merge hook is a script that runs automatically after a successful git merge. It helps automate tasks like updating dependencies or cleaning up files.Click to reveal answer
beginner
Where do you place the
post-merge hook script in a Git repository?You place the
post-merge script inside the .git/hooks/ directory of your repository, and make sure it is executable.Click to reveal answer
beginner
What file permissions should a
post-merge hook script have?The
post-merge hook script should have executable permissions, usually set with chmod +x post-merge.Click to reveal answer
beginner
Give an example of a simple
post-merge hook script that prints a message.A simple
post-merge script in Bash:<br>#!/bin/sh echo "Merge completed successfully!"
Click to reveal answer
beginner
Why use a
post-merge hook instead of running commands manually after merging?Using a
post-merge hook automates repetitive tasks, reduces human error, and ensures important steps run every time a merge happens.Click to reveal answer
What triggers the
post-merge hook in Git?✗ Incorrect
The
post-merge hook runs automatically right after a successful git merge.Where should the
post-merge hook script be located?✗ Incorrect
Git looks for hook scripts inside the
.git/hooks directory of the local repository.Which command makes a
post-merge hook script executable?✗ Incorrect
You use
chmod +x to give execute permission to the hook script.What is a common use of a
post-merge hook?✗ Incorrect
A
post-merge hook often runs commands like updating dependencies or rebuilding files after a merge.Can the
post-merge hook run on a remote server automatically?✗ Incorrect
Git hooks like
post-merge run only on the local machine where the merge happens.Explain what a
post-merge hook is and describe a simple task it can automate.Think about what happens right after you combine code changes.
You got /3 concepts.
Describe how to set up a
post-merge hook script in a Git repository.Focus on where the script goes and what permissions it needs.
You got /3 concepts.