How to import changes from a GitHub template?

1.4k views Asked by At

Thank you for reading my question.

I used GitHub's template feature to generate a repository from a publicly available template.
The template repository has develop and stable branches, and I only used and generated the stable branch.

I did dozens of commits against the generated repository. One day, the stable branch of the template repository was updated to fix a critical vulnerability.
I tried to incorporate the changes because the vulnerability is very much a part of my generated repository.

Here's the question: When GitHub generates a repository from the template repository, it combines the template changes into a single commit and commits it under my name as Initial commit.
What is the best way to import changes from the template repository?

  1. Add template to the git remote and merge the template changes.
  2. Add template to the git remote and create a template branch, and cherry-pick every time you change the template.
  3. Manually rewrite the changed file and commit it with my signature.
  4. Do not use the template feature. Use it in the form of a fork.

Method 1 caused serious conflicts and did not work properly.
Method 2 has minimal conflicts and is the best thing in my idea.

I am using a translator, so if you have any questions, please comment and I will do my best to answer them. If you have any questions or comments, please comment to me.

Thank you.

0

There are 0 answers