Skip to content

Bare Repository

In one line

A bare repository has no working directory — it only contains the .git data. It is used as a remote for pushing and pulling.

In simple words

A bare repository is a Git repository that has no working directory — it only contains the contents of the .git folder, not a checkout of files. You cannot edit files or run git add in a bare repo.

Bare repositories are used as central remotes (like a GitHub server). Developers push to and pull from them, but no one works directly in them. Creating a bare repo with git init --bare sets it up for this purpose.

The convention is to name bare repositories with a .git suffix (e.g. project.git). When you clone, Git creates a normal (non-bare) repository with a working directory from the bare remote.

Example

bash
# Create a bare repository
git init --bare project.git

# Clone from it (creates a normal repo with working directory)
git clone project.git my-project
cd my-project
# Now you can edit, add, commit, and push back

Bare repos are for pushing/pulling; they have no working directory.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary