Display the current Git 'version' in PHP

前端 未结 6 703
醉话见心
醉话见心 2021-01-30 11:37

I want to display the Git version on my site.

How can I display a semantic version number from Git, that non-technical users of a site can easily reference when raising

6条回答
  •  再見小時候
    2021-01-30 12:18

    I did it just as:

    substr(file_get_contents(GIT_DIR.'/refs/heads/master'),0,7)

    resource friendly and the same as i have under eclipse shown

提交回复
热议问题