GitHub: What is the difference between Template and Fork concepts and when to use?

Viewed 3263

I was wondering how GitHub templates differentiates from forks and why should I use them instead of forking a repository?

2 Answers

As far as I understood, you can't pull updates from templates the same way you can pull them from forks. You are unable to push changes to the forked repository as well.

Templates are intended to use a repository as-is, and to use it as a boilerplate to build for example a website. It's not meant to be up-to-date with the main repository.

Edit: Also you can't fork your own repositories on GitHub; you can however use your own templates.

These are included in the official docs as well link

  • A new fork includes the entire commit history of the parent repository, while a repository created from a template starts with a single commit.
  • Commits to a fork don't appear in your contributions graph, while commits to a repository created from a template do appear in your contribution graph.
  • A fork can be a temporary way to contribute code to an existing project, while creating a repository from a template starts a new project quickly.
Related