运行Bump Version时实际会发生什么变化?

时间:2017-04-06 09:05:18

标签: git release git-flow

根据http://nvie.com/posts/a-successful-git-branching-model/

$ git checkout -b release-1.2 develop
Switched to a new branch "release-1.2"
$ ./bump-version.sh 1.2
Files modified successfully, version bumped to 1.2.
$ git commit -a -m "Bumped version number to 1.2"
[release-1.2 74d9424] Bumped version number to 1.2
1 files changed, 1 insertions(+), 1 deletions(-)

After creating a new branch and switching to it, we bump the version number. Here, 
bump-version.sh is a fictional shell script that changes some files in the working 
copy to reflect the new version. (This can of course be a manual change—the point 
being that some files change.) Then, the bumped version number is committed.

但我们还没有将分支命名为release-1.2,我认为我们会在发布时将master标记为1.2,那么./bump-version.sh 1.2到底有什么变化?< / p>

感谢。

1 个答案:

答案 0 :(得分:2)

首先,该帖子中的脚本是一个虚构的shell脚本。所以这只是意味着您必须更新文件以反映新版本

  

创建新分支并切换到它后,我们会修改版本号。在这里,bump-version.sh是一个虚构的shell脚本,它可以更改工作副本中的某些文件以反映新版本。 (这当然可以是手动更改 - 关键是某些文件会发生变化。)然后,提交的版本号将被提交。

上述文件表示所有具有版本号描述的文件。可以是readme.md文件,或gradle文件,或其上带有硬编码版本号的源代码,或任何其他内容

此文件的示例是django存储库中的django/__init.py文件。因此,对于下一个版本(假设它们将编号为2.2.0),该文件应该变成这样的

from django.utils.version import get_version

VERSION = (2, 2, 0, 'alpha', 0)

__version__ = get_version(VERSION)

...

编辑:

相关提交示例:https://github.com/django/django/commit/92fad87958763a649c698cf28b99ec2c4a2fd109#diff-484b5b08de7d25a106a8855101e2423e

相关问题讨论:https://github.com/nvie/gitflow/issues/26