github

GitHub - Pull changes from a template repository


I have created a Template Repository in GitHub and then created some repositories based on the template. Since they were created, there have been updates to the template that I want to pull into those repositories.

Is this possible?


Solution

  • On the other repositories you have to add this template repository as a remote.

    git remote add template [URL of the template repo]
    

    Then run git fetch to update the changes

    git fetch --all
    

    Then is possible to merge another branch from the new remote to your current one.

    git merge template/[branch to merge] --allow-unrelated-histories
    

    https://help.github.com/en/articles/adding-a-remote