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.
Practice questions
Which initial option on the new repository form pre-fills a list of file patterns that Git should not track?
- .gitignore template
- README file
- License
- 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.
Which statements about template repositories are correct?
- The setting is enabled in the repository's Settings
- A generated repository gets the files and structure of the default branch
- The person generating can choose to include all branches
- The generated repository shares commit history, so pull requests back to the template are easy
- 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: 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.
