Git provides built in ability to communicate with a remote repository, why do I need Bitbucket Server

Still need help?

The Atlassian Community is here for you.

Ask the community

 

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

 

 

Question

Git provides built in ability to communicate with a remote repository using the git protocol, why do I need Bitbucket Server

Answer

Bitbucket Server sits between the end user and the raw repositories to provide security (project, repository, and even branch level permissions), to implement a workflow for changes to a branch being merged into a parent branch after commentary, and approvals, and Bitbucket Server provides a platform for other plugins that need to interact with your repository. To accomplish this the file system and the database work together and the Bitbucket Server code is the glue that connects these two sources of information about each repository.

If you setup Bitbucket Server as your remote git server, you can not use the git transfer protocol to communicate directly with the repositories that are managed by Bitbucket Server. You can only use http or ssh and Bitbucket Server intercepts all of these communications to enforce the rules that have been established.

If you connected directly to the repository using git git://ipaddress/path/to/repo.git then several things would happen.

  1. the Bitbucket Server database would become out of sync with the repository, this would cause Bitbucket Server UI to report incorrectly the actual state of Stash pull requests (merge requests)
  2. any pre or post commit hooks would not run
  3. every individual who would perform this level of communication would have to have read write access to the raw repository (they would also have to know the complete path to the repository which is masked by Bitbucket Server)
  4. no project, repository, or branch level permissions would be enforced.
  5. your repository could get to a state that we would not be able to recover from

I would like to clarify also how Bitbucket Server functions. When you run a command from the client like clone using either http or ssh you have a Git remote defined something like http://username@stash_server:port/context/scm/project/repo/repository.git. \

Bitbucket Server receives this command and will do several checks.

  1. Does username have access to this repository?
  2. Can the request be responded to with data in cache or does it have to be collected with a server side git process?
  3. Are there enough "tickets" available for the server to be able to respond to this request or should it be queued up? This prevents users from pounding a server into the ground with too many requests.

Bitbucket Server also allows you to implement and enforce pre-commit hooks so you can validate commit messages or any other task that you want to implement before a commit is accepted. Bitbucket Server also allows you to set up post-commit hooks so you can notify a build server of new changes or any other task that you want to implement after the commit is accepted.

All of this as well as any functionality that you get from any of the available plugins is not possible if you attempt to communicate with a remote repository directly with the git protocol.

Just to be perfectly clear, we do not support communication directly to a Bitbucket Server managed raw repository using the git protocol.

Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.