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


Posted

in

by

Tags:

Comments

2 responses to “Syncing Git Tags across Repositories”

  1. Haris Avatar
    Haris

    thanks

    1. Paul Avatar
      Paul

      You are most welcome

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.