Saturday, May 24, 2014

git bare repository

mkdir  repo1
cd repo1
git init
Initialized empty Git repository in C:/pierre/gittests/repo1/.git/

this repo1 will contain the .git folder with hooks, info, objects, refs

mkdir  barerepo2.git
cd barerepo2.git
git init --bare
Initialized empty Git repository in C:/pierre/gittests/barerepo2.git/

this barerepo2.git will contain the same files/folders that were in the previous non-bare .git folder,
but they will be directly in C:/pierre/gittests/barerepo2.git/, rather than in C:/pierre/gittests/barerepo2.git/.git

The idea behind a "bare" repository is to use it only for "shared" storage of a project,
and not as a working project. So, "bare" repo is used only on a git server, not on a workstation.
To quote SO:
A bare repository is a git repository without a working copy, therefore the content of .git is top-level for that directory.

By convention, folder containing a bare repo should carry the .git extension.

In the config file there will be a "bare = true" setting.

No comments: