Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a Bitbucket repository "--bare" or not?

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?

like image 235
mochadwi Avatar asked Sep 11 '14 09:09

mochadwi


People also ask

What is a non-bare repository?

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.

What is a bare 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.

What is a repository Bitbucket?

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 -- bare in Git?

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.


2 Answers

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.

like image 178
tjati Avatar answered Sep 24 '22 00:09

tjati


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

like image 38
Ahmed Nawar Avatar answered Sep 26 '22 00:09

Ahmed Nawar