Git & GitHub Interview Question #116
What is a bare Git repository?
Advanced GitHub Actions, Repository Internals, Submodules, LFS & Diagnostic Tools Senior Advanced
Quick Interview Answer
A bare repository contains Git repository data without a normal checked-out working tree. It is commonly used as a central repository that developers push to and fetch from rather than edit directly.
Detailed Explanation
A bare repository contains Git repository data without a normal checked-out working tree. It is commonly used as a central repository that developers push to and fetch from rather than edit directly.
Remote Git servers traditionally store repositories in a bare-like form because no working directory is needed for ordinary collaboration.
Code Example
git init --bare project.git
# A developer can clone it:
git clone /path/to/project.git