Syncing Git Tags across Repositories

To sync the tags from one repository to another, you can do the following:

  1. Clone the repository that you want the tags to be in, and change to that cloned repository.
git clone git@github.com:prb112/FHIR.git
cd FHIR
  1. Add a remote to the original repository.
git remote add fhiro git@github.com:IBM/FHIR.git
  1. Check that the remote is there (fhiro).
git remote -v
fhiro	git@github.com:IBM/FHIR.git (fetch)
fhiro	git@github.com:IBM/FHIR.git (push)
origin	git@github.com:prb112/FHIR.git (fetch)
origin	git@github.com:prb112/FHIR.git (push)
  1. Fetch the original tags.
git fetch fhiro --prune --tags
  1. Check the tags are shown.
git tag --list
  1. Remove the remote.
git remote remove fhiro
  1. Check that the remote is removed.
git remote -v
origin	git@github.com:prb112/FHIR.git (fetch)
origin	git@github.com:prb112/FHIR.git (push)
  1. Push the tags to the new destination.
git push --tags

Note I did disable the GitHub Actions prior, and re-enabled after.

References

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.