Bitzu

GH-900 ยท Repositories

Creating repositories and templates

Creating a repository, initial options (README, .gitignore, license), and template repositories as a starting point for new repos.

Key points

  • A new repository can start with a README, a .gitignore template and a license.
  • A template repository (marked in its Settings) lets others generate new repositories with the same files and folders as its default branch, optionally with all branches, but without a shared history.

Source: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository

Practice questions

Single choice

Which initial option on the new repository form pre-fills a list of file patterns that Git should not track?

  1. .gitignore template
  2. README file
  3. License
  4. Template repository setting
Show answer

Answer: A. .gitignore template

A .gitignore template lists patterns such as build output or editor files. A README describes the project and a license sets reuse terms; neither controls tracking.

Select all that apply

Which statements about template repositories are correct?

  1. The setting is enabled in the repository's Settings
  2. A generated repository gets the files and structure of the default branch
  3. The person generating can choose to include all branches
  4. The generated repository shares commit history, so pull requests back to the template are easy
  5. Files stored with Git LFS are fully supported in templates
Show answer

Answer: A. The setting is enabled in the repository's Settings, B. A generated repository gets the files and structure of the default branch, C. The person generating can choose to include all branches

Templates are enabled in Settings, generate the default branch's files and structure, and let the generator include other branches. Repositories using Git LFS files cannot be templates, and generated repos do not share history with the template.

True or false

True or false: a repository generated from a template shares commit history with the template, so you can open pull requests between them.

Show answer

Answer: False

False. Generated repositories have unrelated histories, so you cannot merge or open pull requests between them the way you can with a fork.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More GH-900 topics in this module