Skip to content
AgileLogics

Programming glossary

Repository

A project's codebase tracked by a version control system, including its full history of changes.

Where a project and its history live

Every Git project you create or clone is a repository, or "repo" for short: a folder that a version control system watches. Alongside your normal files it keeps a hidden database of every saved change, recording who made it, when, and why. With Git, that database lives in a .git directory at the top of the project. Delete that directory and you're left with plain files and no history.

Think of a repo as a project folder with a detailed logbook attached. You can flip back through the log, see how any file looked last month, or compare two versions line by line.

Creating and cloning a repo with Git

git init my-app          # start a new, empty repository
cd my-app
git add README.md
git commit -m "Add readme"

git clone https://github.com/user/project.git   # copy an existing repo

git clone downloads the files and the complete history, so your copy is a full repository in its own right.

Local vs remote repositories

Git is distributed: every clone is a complete repo. The one on your laptop is your local repository. A copy hosted on a service such as GitHub, GitLab, or Bitbucket is a remote. You git push your commits to the remote and git pull other people's commits down, which is how a team keeps in sync.

Don't confuse the repository with the hosting site. GitHub is a place that stores repos and adds features like pull requests and issue tracking; Git itself is the tool that manages history. You can use Git with no hosting service at all.

The word also turns up elsewhere. Package registries are sometimes called repositories, and in application code a "repository pattern" means a class that handles data access. In the context of version control, it always means a project tracked along with its history.

Learn more

Last updated