Skip to content

    Bare repository

    Reading time: 2 min.Editorially reviewed on:

    Definition

    A bare repository stores the Git history and management data without the usual checked-out working directory in the repository folder.

    A bare repository is a Git repository without the usual local working tree containing checked-out project files. It contains the repository data directly and is suitable, for example, as a shared exchange point for push and fetch. To edit files, a separate working copy is usually used.

    Simply explained

    It is the shared version archive, not the workspace where you directly edit the project files.

    Why it matters in practice

    The distinction helps to set up central Git repositories correctly and not confuse them with a normal local working copy.

    Example from business

    Example: A team sets up a bare repository on an internal server, with which its local working copies exchange changes.

    Limits and pitfalls

    • Bare does not mean empty or automatically backed up. Access protection, backup, and reliable operation of the stored history must be organized separately.

    Origin & history

    Git separates repository data from checked-out files. Bare repositories use this separation for repositories primarily serving exchange purposes.

    Use in mid-sized companies

    • Companies can provide Git histories centrally while employees edit changes in their own working directories and then push them.

    Frequently asked questions

    Can a bare repository contain many versions?

    Yes. Bare describes the absence of the usual checked-out working directory, not the scope or age of the stored history.

    Sources

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice