简体   繁体   English

Git标记不变的仓库

[英]GIt tagging unchanged repo

We have 10 repositories that's being used for each release. 每个发行版都有10个存储库。 Currently, we have a branch for each release and everyone has to remember which release has been changed. 当前,我们为每个版本都有一个分支,每个人都必须记住哪个版本已更改。

For example:- 例如:-

Repository repo1 - 
     repo1_feature_1_branch

Repository repo2 - 
     repo2_feature_1_branch

Repository repo3 - Unchanged for this release.

So, when the deployment happens, we pull the code from repo1_feature_1_branch, repo2_feature_1_branch. 因此,当部署发生时,我们从repo1_feature_1_branch,repo2_feature_1_branch中提取代码。 Since repo3 has not been changed we don't pull the code. 由于repo3尚未更改,因此我们不会提取代码。

We want to change this into to be consistent across all repositories. 我们希望将其更改为在所有存储库中保持一致。

New plan. 新计划。

Merge the feature branch(ie; repo1 and repo2) to master and tag it(new-release-3). 合并功能分支(即repo1和repo2)以对其进行主控和标记(新发行版3)。 Create a new tag commit for repo3(new-release-3). 为repo3(new-release-3)创建一个新的标签提交。

When deploying the code every repo will be consistent. 部署代码时,每个存储库都是一致的。 ie. 即。 pulled from new-release-3 tag. 从new-release-3标签中提取。

How do I tag the repo3 to new-release-3 when there is no changes. 没有更改时,如何将repo3标记为new-release-3。

You can tag just tag repo3 with git tag new-release-3 (for a lightweight tag), no matter if there are changes or not. 您可以使用git tag new-release-3 (对于轻量级标签)仅对repo3进行git tag new-release-3 (无论是否进行了更改)。 A tag is not a commit, it's just a poniter to a certain commit. 变量没有提交,它只是一个poniter一定承诺。 If the master branch does not change over several releases, there will be multiple tags pointing to the current HEAD commit, but that should not bother you. 如果master分支在多个发行版中未更改,则将有多个标记指向当前HEAD提交,但这不会打扰您。 You can just check it out and be on the correct commit for the given release. 您可以将其签出,并针对给定的版本进行正确的提交。

For more information about annotated and lightweigt tags, see here . 有关带注释的标签和lightweigt标签的更多信息,请参见此处

It's very reasonable to change your workflow from different branches to tags, since it's much easier and less error prone to check out older versions. 将您的工作流程从不同的分支更改为标签是非常合理的,因为签出较旧的版本更容易且更容易出错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM