What is git clone –bare command?

What is git clone –bare command?

Sometimes we need to share out git repo instead of whole working directory. In that case git clone --bare command can be used:

git clone --bare https://some-repository-link.github.com/project.git .git

After this command in the current directory git bash only create .git (hidden) repo directory and not any of the working folder or files.

Convert from bare repo to working repo

With two steps it is very easy:

First, set the core.bare config value to false :
$ git config --bool core-bare false
then enter the following command to HARD reset your HEAD to initial commit and finally it will create your repos working directory:
$ git reset --hard

Previous post:

Leave a Reply

Your email address will not be published. Required fields are marked *