How do a repository, Git and GitHub differ?
The Harvard Chan AI Glossary
In our classes, we often pause to explain the ideas behind AI and the language used to describe it. These posts grew out of those conversations. They’re for anyone who would like to understand AI better, with no technical background assumed.
A repository is a place where a project’s files are organized and, when used with version control, their changes are recorded. Git is a version-control tool: software for tracking changes over time. GitHub is a service that hosts Git repositories and adds facilities for collaboration, review and project management. The three names describe different things.
Imagine several versions of a document called “final,” “final revised” and “final really revised.” Version control provides a more systematic history. In Git, a commit is a recorded set of changes with an identifying reference and a message. It lets people examine what changed rather than relying only on the current files.
A branch is a separate line of development. Someone can try a change without immediately altering the shared main version. A merge combines changes from different lines. On GitHub, a pull request is a proposal to bring changes into another branch, accompanied by discussion and review. It is not the same as making the new version available to users.
Deployment is the separate act of putting a version into an environment where it can run. Some teams connect merging and deployment through automation; others require additional steps. Understanding the distinction prevents “the code is merged” from being mistaken for “the feature is live and verified.”
Repositories can hold more than code. They may include requirements, instructions, tests and project documentation. Keeping these records together lets people compare agreed behavior with what was built. Sensitive credentials and private data require separate care; a repository is not automatically an appropriate place for everything a project uses.
Git can be used without GitHub, including on a local computer. GitHub adds a shared place to coordinate work, but it is not the only service capable of hosting Git projects. Saving a file locally and pushing recorded changes to a shared repository are also separate actions.
A team building a clinic follow-up dashboard could keep the code, requirements and fictional test cases in a repository. A proposed change to what counts as an overdue case would then be reviewable alongside the tests that express that rule. Merging the change would not, by itself, show that the live clinic dashboard has been updated or checked. Patient records should remain in their authorized systems, not be included merely for convenience. Version control preserves the history of the work; it does not certify its correctness.
Sources: Git — About Version Control; GitHub — What Is GitHub?.
If you would like to find out more about AI and improve your leadership skills, consider the AI in Health Care Certificate of Specialization from the Advanced Learning Academy at Harvard T.H. Chan School of Public Health. You can take an individual course or work toward the full certificate.
AI is a fast-moving field. This explanation reflects our class discussions and related material at the time of writing. Terminology, capabilities and tools may change.
For suggested additions or corrections, please email me at tpanch@hsph.harvard.edu.
Dr. Trishan Panch
Program Director, AI in Health Care
Harvard T.H. Chan School of Public Health — Advanced Learning Academy