Merge changes from GitHub template repository
So to sync changes from upstream template repository, we need to use
git command line:
git remote add template <repo>
Fetch template changes
git fetch --all
--allow-unrelated-historiesto merge, we may also need to manually resolve all the merge conflicts.
git merge --allow-unrelated-histories --squash template/<branch>
--allow-unrelated-histories: By default, git merge command refuses to merge histories that do not share a common ancestor. This option can be used to override this safety when merging histories of two projects that started their lives independently. As that is a very rare occasion, no configuration variable to enable this by default exists and will not be added.
There is also GitHub action actions-template-sync which can be configured to automatically sync changes from template.