简体   繁体   中英

GIt tagging unchanged repo

We have 10 repositories that's being used for each release. 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. Since repo3 has not been changed we don't pull the code.

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). Create a new tag commit for repo3(new-release-3).

When deploying the code every repo will be consistent. ie. pulled from new-release-3 tag.

How do I tag the repo3 to new-release-3 when there is no changes.

You can tag just tag repo3 with git tag new-release-3 (for a lightweight tag), no matter if there are changes or not. A tag is not a commit, it's just a poniter to a certain commit. 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. 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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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