美文网首页
Make 如何获取 git 提交信息

Make 如何获取 git 提交信息

作者: 陈卧虫 | 来源:发表于2023-02-19 00:56 被阅读0次

Makefile

GIT_SHA = $(shell git rev-list HEAD | awk 'NR==1')
GIT_SHORT_SHA = $(shell git describe --always --abbrev=7 --dirty)
GIT_DATE = $(shell git log --pretty=format:%cd ${GIT_SHA} -1)
GIT_BRANCH = $(shell git branch | sed -n '/\* /s///p')
GIT_TAG_LABLE = $(shell git tag --sort=-taggerdate|head -n '1')
GIT_SVR_PATH = $(shell git remote -v | awk 'NR==1' | sed 's/[()]//g' | sed 's/\t/ /g' |cut -d " " -f2)

test:
        @echo ${GIT_SHA}
        @echo ${GIT_SHORT_SHA}
        @echo ${GIT_DATE}
        @echo ${GIT_BRANCH}
        @echo ${GIT_TAG_LABLE}
        @echo ${GIT_SVR_PATH}

result

hello-c git:(master) ✗ make test
2fbce11af0895cd79db0745103b87d28c6e1730d
2fbce11-dirty
Mon Feb 20 00:39:12 2023 +0800
master
v0.0.0
github.com/hello-c

相关文章

  • Make 如何获取 git 提交信息

    Makefile result

  • git常用命令

    git add . git commit -m "message"提交,其中message是提交的信息。 git ...

  • Git 上传提交问题 The local repository

    git上传提交遇到问题 The local repository is out of date.Make sure...

  • git使用中的总结

    一张图掌握Git Git Bash常用命令 修改git commit 最后一次提交的注释信息 以及如何退出git ...

  • git 修改最近的 commit message

    git 修改已经的提交信息 当我们使用 git 提交代码之后我们发现,提交信息描述有问题,想要仅仅修改描述信息而不...

  • 获取提交信息

    index.jsp result.jsp

  • 2.4_提交信息

    如何编写提交信息 你将向你的反思版本库进行第一次提交。在你这样做时,需要编写提交信息,以说明所做的更改。在git工...

  • iOS获取Git信息

    目标:在iOS的App中获取到当前包所属的Git信息。这里我需要当前代码的提交日期、提交作者、代码所属分支、代码的...

  • git随笔

    git 常用操作 修改提交信息本地撤销修改记录git commit --amend通过此命令进入到提交信息界面,...

  • DevOps之git日志信息解读

    DevOps之git日志信息解读 1 版本信息 2 提交作者 3 提交时间 4 提交mes...

网友评论

      本文标题:Make 如何获取 git 提交信息

      本文链接:https://www.haomeiwen.com/subject/htcikdtx.html