in Git by
Q:
What is the bare Git repository? How is it different from a standard/non-bare Git repository?

▼ Show 1 Answer

0 votes
by

Repositories that are created through git init command are the standard/non-bare Git repositories.

In the top-level folder of such repository, you will find two things:

A .git subdirectory keeping all metadata and track of the history of your repo.

A working tree.

The repositories which are created using git init –bare command are known as bare Git repositories. They are mainly used for sharing. They do not contain any working tree. They keep the git revision history of your repository in the root folder rather than having it inside the .git subfolder.

It just contains bare repository data. This is how a bare Git repository is different from a standard Git repository. Also, a bare repository does not have a default remote origin repository as it serves as an origin repository for multiple remote users.

Since a bare repository does not contain any workspace, the git push and git pull commands do not work over a bare repo. You are not required to commit any changes to a bare repo.

GIT
Learn More with Madanswer

Related questions

0 votes
asked Sep 3, 2020 in Git by SakshiSharma
...