Getting Started Git Basics Repository
Repository
Learn what a Git repository contains and how it differs from the worktree.
Reviewed against GitComet 0.3.3
A Git repository is a project folder that Git tracks, together with the history of changes for that project.
When people say "repository" or "repo," they usually mean the whole Git project: the files you are working on now, plus the commit history, branches, tags, and other Git data that belong to that project.
What a repository contains
A typical repository with a working tree includes two closely related parts:
- The project files you can see and edit.
- The Git data that stores the project's history and structure.
That Git data includes things like:
- Commits, which record saved snapshots of the project.
- Branches, which point to different lines of development.
- Tags, which give names to specific commits.
- Configuration and references Git uses to keep track of the repository.
In most repositories, the Git data is stored in a hidden .git folder inside the project directory. You usually do not need to work with that folder directly, but it is what makes the folder a Git repository instead of just a normal directory of files.
Repository vs worktree
It helps to separate the idea of the repository from the files currently on disk.
The repository is the full Git project, including its history. The worktree is the current checkout of files that you are editing right now. When you change a file, you are changing the worktree. When you stage and commit those changes, Git records them in the repository history.
Bare repositories
A bare repository stores Git history and configuration without an active working tree. GitComet can open it to browse history, reflog, committed files, diffs and blame; fetch and push; and manage branches, remotes and linked worktrees.
The Git Bare badge identifies this mode. Actions that need working files, such as staging, committing, ordinary Git pull, checkout and merging, are disabled with an explanation. The Files sidebar shows the selected commit or HEAD instead of working files. You can create a linked worktree to work on a checkout.
To convert the repository in place, choose Git Bare → Disable bare mode. GitComet checks the layout first and asks for confirmation for a genuine bare repository. Conversion keeps the folder path, moves Git data into .git, and creates working files from HEAD. Stop other Git tools and server jobs using the repository or its worktrees before confirming, and keep them stopped until conversion finishes.
Some layouts cannot be converted safely; GitComet reports the reason without changing them. If conversion is interrupted, reopening the repository resumes recovery. Preserve any backup or recovery paths named in an error. See the bare repository reference for restrictions, recovery, and large-file support.
Local repository and remote repository
A local repository is the copy of the repository on your own machine. This is the copy GitComet works with directly.
A remote repository is another copy of the same repository hosted somewhere else, such as GitHub, GitLab, or a company server. Remotes are mainly used to share work with other people and synchronize changes between collaborators.
Because Git is distributed, your local repository already contains the history it needs for normal work. You can inspect commits, create branches, stage changes, and make commits locally. You only need a remote when you want to exchange changes with another copy of the repository.
What you open in GitComet
In GitComet, you usually open the local repository on your machine. That means you select the project folder that contains the Git repository.
Once the repository is open, GitComet can show you:
- The files currently changed in your worktree.
- The staged and unstaged state of those changes.
- The commit history and branches stored in the repository.
- The remotes connected to that repository.
If a folder is not a Git repository yet, GitComet cannot show Git history for it until Git has been initialized there or the project has been cloned from an existing repository.