I already created a repository. Can I make it a bare type or shall I start over?
On GitHub.com, navigate to the main page of the repository. Above the list of files, click Code. Click Open with GitHub Desktop to clone and open the repository with GitHub Desktop. Follow the prompts in GitHub Desktop to complete the clone.
To Git clone a repository navigate to your preferred repository hosting service like GitHub, select the repository you want to clone, copy the repository URL via HTTPS or SSH, type git clone in the command line, paste the URL, and hit enter .
What is a bare repository? A bare repository is the same as default, but no commits can be made in a bare repository. The changes made in projects cannot be tracked by a bare repository as it doesn't have a working tree. A working tree is a directory in which all the project files/sub-directories reside.
According to the FAQ, conversion from non-bare to bare can be done in two ways. The best one:
$ git clone --bare -l repo repo.git $ rm -rf repo
To create a bare repository from scratch:
$ mkdir repo.git $ cd repo.git $ git --bare init
Just move the .git
folder away from the working copy.
mv /var/git/repo/repo/.git /var/git/repos/repo.git
You might want to follow that up with a
git config --bool core.bare true
in that repository, just in case git
complains about something not being right.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With