GitHub Repository Naming
info
This content is mandatory for new repositories
This best practice describes how to name GitHub repositories.
Rationale
Having a consistent git repo naming convention makes identifying and maintaining git repositories easier for engineers.
For each convention the relevant rationale is as follows:
- Having a standard case format keeps consistency across repos. We need to decide on one and this aligned more with other external repos (i.e. GitHub; see reference image below).
- All GitHub projects are within the CRUKorg organisation. There is no need to add another prefix as this is already prepended. Furthermore it makes sorting and searching more difficult.
- Clearly identifying what product is associated with a repo aids readability and search.
- Implementations can change over time; there is no need to specify this in the repo.
- This suggests a break from a monorepo approach where all product packages are within a single repo. Consider removing the suffix and combining the repos.
- Avoid terms that will not evolve with the product and lock in specific aspects. For example
activity-management-angular-app
is not future friendly if the app should move to react. Doing this avoids unnecessary repo name changes in the future. - Ideally the product name should be in the repo; without it generic names are formed which are unhelpful. Names such as
submission
,event
,server-api
are too generic and are not descriptive on what the repo is. - This aids search, sorting and keeps like products together.
Description
When naming (or renaming) a GitHub repo please follow the following conventions.
- Use
kebab-case
; all lowercase letters with words separated by hyphens. - Do not prefix with
cruk
. - Keep the name clear and concise.
- Avoid specific implementation details i.e.:
php
,rest
,serverless
. - Avoid
client
andserver
suffixes; instead use a monorepo approach. - Future friendly.
- Descriptive.
- If multiple repos are required keep prefixes the same for the same product.
Renaming a legacy repository may not be possible, in which case we recommend adding an 'about' to the repo to provide further context if its name doesn't follow the above convention.
Examples
Names that follow the convention: ✔️
- activity-management
- engineering-guidebook
- semarchy
- tibco
- ecommerce
- cookie-banner
- online-payments
- personhub
Names that do not follow the convention: ❌
- cruk-activity-management : unnecessary cruk prefix.
- cruk_engineering_guidebook : underscores instead of hyphens.
- ActivityManagement : mixed case
- activity-management-client & activity-management-service : suggests a break in monorepo convention. Combine repos where possible for the same products.
- activity-management-haskell-websphere : Locked in implementation details that are not future proofed.