获取git的tag
2021-01-26 本文已影响0人
malgee
- 用于查找最近的tag
git describe
- 把--abbrev设为0, 该命令查找最近的tag名,不需要后缀:
git describe --abbrev=0
- 获取当前分支的tag
git describe --abbrev=0 --tags
- 获取所有分支的tag
git describe --tags `git rev-list --tags --max-count=1`
- 获取当前分支提交的commitId
git rev-parse HEAD
- 获取最近10条提交的信息commit
git log --pretty=oneline --abbrev-commit -n 10