0

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.

user1050619
  • 19,822
  • 85
  • 237
  • 413
  • Merging feature branches and tagging releases is a separate and unrelated process. You would merge first, then run tests etc., and after everything is ready, you would tag whatever commit is stable. Doing that does not require you to create *any* commit whatsoever. You can tag any commit at any time in any repository. – poke Jul 31 '17 at 12:07
  • A project that involves 10 repositories is a big one. You could consider using Google's REPO(https://source.android.com/source/using-repo) to manage the repositories. – ElpieKay Jul 31 '17 at 12:10

1 Answers1

0

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.

kowsky
  • 12,647
  • 2
  • 28
  • 41
  • Is there a tool to automatically tag multiple reposiories? – user1050619 Jul 31 '17 at 12:31
  • There is no git-internal functionality, but there are multiple tools. I never worked with any of them, but take a look at [this question](https://stackoverflow.com/questions/816619/managing-many-git-repositories) and especially [this answer](https://stackoverflow.com/a/9723694/7598462). – kowsky Jul 31 '17 at 12:42