Automatically launch git when creating a git tag

Is there a Git hook that can be triggered when a new Git tag is added? Because I want to automatically write new Git tag names to a text file. Do you have a clue on how to do this?

+5
source share
1 answer

While it is currently not possible to use interceptors, you can always create a simple script.

mytag.sh:

#!/bin/sh
[ -z "$1" ] || ( git tag $1 && git tag > /path/to/your-tags-file )

then:

chmod +x mytag.sh
git config alias.mytag !/path/to/mytag.sh
+1
source

All Articles