Work with GitHub Repositories
This skill area is 10–15% of the exam. It covers the anatomy of a repository and its key community-health files, creating and organizing repos with templates and branches, adding and managing files, and using insights, stars, and metrics for visibility and maintenance.
Repository Structure & Key Files
A GitHub repository stores your project's files and their full revision history. Certain community health files have special meaning — GitHub surfaces them in the UI. Know each one and its purpose.
| File | Purpose |
|---|---|
README.md | The front page of the repo — describes what the project is, how to install and use it. Rendered automatically on the repo home page. |
LICENSE | Defines the legal terms under which others may use, modify, and distribute the code (e.g. MIT, Apache-2.0, GPL). Without it, default copyright applies. |
CONTRIBUTING.md | Guidelines for how to contribute. GitHub links to it when someone opens an issue or PR. |
CODEOWNERS | Defines individuals/teams responsible for code in specific paths. Owners are automatically requested for review when matching files change. |
SECURITY.md | Explains how to responsibly report a security vulnerability in the project. |
CODE_OF_CONDUCT.md | Sets community behavior expectations for participants. |
.gitignore | Lists files/patterns Git should not track (build output, secrets, local config). |
CODEOWNERS is a favorite exam target: its job is to automatically request review from the right people when files they own are modified in a pull request. It can live in the repository root, .github/, or docs/.
Place default community health files (CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, issue/PR templates) in a special .github repository in your organization, and they apply to every repo that doesn't define its own. This avoids duplicating the same files everywhere.
Create, Organize & Maintain Repositories
You can create a repository from scratch, from a template, or by importing/forking. When creating, you choose an owner (you or an org), a name, visibility (public/private), and optional initialization (README, .gitignore, license).
Template Repositories
- A template repository lets anyone generate a brand-new repo with the same directory structure and files as a starting point.
- Unlike a fork, a repo created from a template does not include the commit history of the template and is not linked to it — it starts with a single clean commit.
- Great for boilerplate, starter kits, and standardizing new-project scaffolding.
Template: fresh start, no shared history, independent project. Fork: keeps full history and stays linked to the upstream repo so you can open pull requests back to it. Choose a template for scaffolding; choose a fork to contribute changes upstream.
Branches
- The default branch (typically
main) is what visitors see first and the base for new branches and pull requests. - Create branches to organize parallel work (features, fixes, experiments) without destabilizing
main. - Branches can be protected with rules (covered under Privacy, Security & Admin) to enforce reviews and passing checks before merge.
Adding & Managing Files
Ways to Add and Edit Files
- Web UI — use "Add file → Create new file" or "Upload files"; edit any file with the pencil (✏️) icon and commit directly or to a new branch.
- Git CLI —
git add,git commit,git pushfrom a local clone. - GitHub Desktop — commit and push through a GUI.
- github.dev — press . in a repo to open a lightweight browser editor for quick edits.
When you edit a file on GitHub.com, you can commit directly to the branch or create a new branch and start a pull request. Choosing the new-branch option is the GitHub-Flow-friendly path for reviewed changes.
Insights, Stars & Metrics
GitHub provides visibility tools to track a repository's activity, health, and dependencies.
| Feature | What it shows |
|---|---|
| Insights tab | Pulse (recent activity), contributors, traffic, commit and code-frequency graphs, and community-standards checklist. |
| Stars | A bookmark and popularity signal — users star repos to save them and to show appreciation. Star counts help others gauge a project's reach. |
| Watch | Subscribe to notifications about a repo's activity (all activity, or just releases/issues). |
| Dependency graph & insights | Shows the packages/projects the repo depends on and repos that depend on it; underpins Dependabot alerts. |
| Feature previews | Opt in to try new/beta GitHub features before general availability. |
Three easily-confused actions: Star = bookmark / show appreciation (no notifications). Watch = subscribe to activity notifications. Fork = make your own copy to modify or contribute back. Expect a question distinguishing these.
Maintenance Best Practices
- Keep a clear, current README and complete community health files.
- Use branches and pull requests (never commit straight to
mainon shared projects). - Apply labels, issues, and milestones to keep work organized.
- Enable Dependabot to keep dependencies patched.
- Archive stale repositories (read-only) rather than deleting history; delete merged branches to reduce clutter.
- Set branch protection on important branches to require reviews and status checks.
Study Resources
- GitHub Repositories Documentation The authoritative reference for creating, managing, and maintaining repositories.
- Community Health Files (GitHub Docs) README, LICENSE, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, and CODEOWNERS explained.
- Creating a Template Repository (GitHub Docs) How templates differ from forks and when to use them.
- GitHub Foundations — Part 1 (Microsoft Learn) Includes modules on repositories and managing files.