开发者

Automatically run Git hook when creating a Git tag

开发者 https://www.devze.com 2023-01-27 07:19 出处:网络
Is there a Git hook which can be executed when a new Git tag is adde开发者_如何学Cd? Because I want to automatically write new Git tag names into a textfile. Do you have a clue on how to do this?While

Is there a Git hook which can be executed when a new Git tag is adde开发者_如何学Cd? Because I want to automatically write new Git tag names into a textfile. Do you have a clue on how to do this?


While it's not currently possible using hooks, 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
0

精彩评论

暂无评论...
验证码 换一张
取 消