Applying the existing tag on a new commit in Git

你离开我真会死。 提交于 2019-12-08 16:07:37
VonC

Every build changes should be tagged. so that we can get the specific commit at anytime.

Your build process should rather incorporate the last tag and the current SHA1, using git describe.

You can see an example in "Automatic versioning in Xcode with git-describe" (or even git describe --dirty), using

VERSION=`git describe --dirty |sed -e "s/^[^0-9]*//"`

Other examples:

That way:

  • the binary you are building includes the information allowing you to know what exact version of the code was used to make said build.
  • you limit the tags to the actual versions that count (like a stable version used to make an official release)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!