如果有办法看到给定推送中包含的确切内容,我就会徘徊。我正在寻找提交和推送元数据之类的东西。
答案 0 :(得分:1)
是的,您可以使用钩子通过git hooks找出提交内容的内容。您可以使用pre-receive
或post-receive
挂钩
pre-receive
/post-receive
强> #!/bin/sh
# assuming this is not teh first commit. it it is you will have to add extra lines of code
# Check to see if we have updated the given file
# the content can be grabbed using this command:
if [ $(git diff-tree -r --name-only HEAD^1) ];
# Output colors
red='\033[0;31m';
green='\033[0;32m';
yellow='\033[0;33m';
default='\033[0;m';
# personal touch :-)
echo "${red}"
echo " "
echo " |ZZzzz "
echo " | "
echo " | "
echo " |ZZzzz /^\ |ZZzzz "
echo " | |~~~| | "
echo " | |- -| / \ "
echo " /^\ |[]+ | |^^^| "
echo " |^^^^^^^| | +[]| | | "
echo " | +[]|/\/\/\/\^/\/\/\/\/|^^^^^^^| "
echo " |+[]+ |~~~~~~~~~~~~~~~~~~| +[]| "
echo " | | [] /^\ [] |+[]+ | "
echo " | +[]+| [] || || [] | +[]+| "
echo " |[]+ | || || |[]+ | "
echo " |_______|------------------|_______| "
echo " "
echo " "
echo " ${green}You have just committed code "
echo " "
echo "${default}"