Need Help on Git Level 4 – Git Hook Task (Post-Update Tag Creation)

Hello Folks,

I’m working on the Git Level 4 - Task 4 (Git Hook)

Following tasks:

The Nautilus application development team was working on a git repository /opt/ecommerce.git which is cloned under /usr/src/kodekloudrepos directory present on Storage server in Stratos DC. The team want to setup a hook on this repository, please find below more details: Merge the feature branch into the master branch, but before pushing your changes complete below point. Create a post-update hook in this git repository so that whenever any changes are pushed to the master branch, it creates a release tag with name release-2023-06-15, where 2023-06-15 is supposed to be the current date. For example if today is 20th June, 2023 then the release tag must be release-2023-06-20. Make sure you test the hook at least once and create a release tag for today’s release.

What I have done so far:

  1. Merged the feature branch into master locally.
  2. Confirmed that /opt/ecommerce.git is a bare repository.

I am not sure about the structure of post-update script file that would work for this tasks.

Can anyone please guide me on it.

Thanks,
Sohel.

Hi @Sohelk

See if this can help you and this one for git hooks.

There is a hooks subdir in .git dirof the project which contains some samples like post-update.sample.

Hello Santosh,

Thank you for sharing links. I will check and update on it.

Thanks,
Sohel.