I just created a Bitbucket account and already made a few commits to the Bitbucket server. I also invited my team to check the Bitbucket repo for changes.
But, after a while, I found an article saying that every shared repo should be a --bare one.
Is my Bitbucket repo, that I've created via the Bitbucket web interface are --bare one? Or should I create another --bare directory on my machine?
Is this necessary to do what is described in this answer to handle two remote repos?
A non-bare repository contains . git/ as well as a snapshot of your tracked files that you can directly edit called the working tree (the actual files you can edit). This is where we edit and commit changes. When we create a repository with git init , it is a non-bare, “normal”, repository.
A bare Git repository is typically used as a Remote Repository that is sharing a repository among several different people. You don't do work right inside the remote repository so there's no Working Tree (the files in your project that you edit), just bare repository data.
This Bitbucket repository will be the central repository for your files, which means that others can access that repository if you give them permission. After creating a repository, you'll copy a version to your local system—that way you can update it from one repo, then transfer those changes to the other.
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.
Yeah, you can assume that your bitbucket-repository is a bare-repository. By design.
Because all repositories that are hosted remote and are only to push-to should be bare. There's no reason to assume something different.
If you are unsure, follow your link and compare. But you don't need another git repository if you are happy with bitbucket as a host.
In Bitbucket's command line instructions to clone a repo, the remote repo named has the .git
extension. From the Git Book,
By convention, bare repository directories end in
.git
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