vtk__mirror_vtk_to_build_with_github_actions - DmitrySemikin/dsemikin_notes GitHub Wiki

Home / Notes on VTK


Mirror VTK Repo to build with GitHub Actions

The solution with --mirror options is not nice (with remore.origin.mirro set to true) for our usecase, because we want to add some extra branches. Solution with mirror would delete those branches on every "sync".

So we will have to always sepcify remote name, and --tags and --all options explicitly:

git clone --mirror https://gitlab.kitware.com/vtk/vtk.git vtk-mirror-for-github.git
cd vtk-mirror-for-github.git
git remote github-target https://github.com/DmitrySemikin/vtk-mirror.git

Now we can do

git fetch --prune
git push --all github-target
git push --tags github-target

We want to keep original branches from the official VTK repo intact, so if some conflict shows up one can use --force to overwrite local changes. I don't do it by default though to have a possibility to save changes, if I still need them.

Not suitable solution with --mirror

Instructions to mirror repo (also on github): https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/duplicating-a-repository#mirroring-a-repository-in-another-location

git clone --mirror https://gitlab.kitware.com/vtk/vtk.git vtk-mirror-for-github.git
cd vtk-mirror-for-github.git
git remote set-url --push origin https://github.com/DmitrySemikin/vtk-mirror.git

Now we can do

git fetch --prune
git push

note, that the second, will automatically do git push --mirror, because config has remote.origin.mirror set to true.

Actual mirror repo: https://github.com/DmitrySemikin/vtk-mirror


Home / Notes on VTK