We don't need a Git repository as we already have one. We just purchased Bitbucket (server) for its code review features. I was a little surprised to find that it doesn't appear to be possible to point it at an existing repository. It seems that we'd have to clone our existing repositories into Bitbucket and then abandon those repositories.
Is it true that Bitbucket only works with internal repositories? If so, why is that?
Hi @Bill Wohler
You have to understand how Git works here.
For any changes to be appeared in the Bitbucket server first create a repository, and wherever your repository is you can push the changes to your server by adding the remote link to your server.
I'm not sure what you mean by internal repositories, please let me know more on that.
Thanks, Pramodh. Let's see if an example will help. Our external Git repository is at, say, git.domain.com and our Bitbucket server is at bitbucket.domain.com. I was referring to any repositories at bitbucket.domain.com as internal. I want the Bitbucket server to use the Git repository at git.domain.com. In other words, our developers want to keep developing on git.domain.com and view their code reviews on bitbucket.domain.com.
We've cloned from git.domain.com:
[wohler@host project (master=)]$ git remote -v
origin ssh://git.domain.com/GIT/project.git (fetch)
origin ssh://git.domain.com/GIT/project.git (push)
It would be preferable if this doesn't change for our developers.
Yes, bitbucket.domain.com is the Bitbucket server.
The requirement is very strange, I guess what you are trying to say is mirroring.
Here's an idea you can try.
Let Bitbucket handle all the git operations (fetch and push) and pull requests.
What you can do is, write a custom script to push the code from the Bitbucket server to External Git Server, or the other way around works too.
Bitbucket Server is not just a code review tool but rather a tool that allows you manage git repositories hosted on it, including code reviews as part of pull requests.
Bitbucket's model is built around the repositories being hosted locally, and that's the way it's always been.
You're probably aware, but you can import your existing repo into Bitbucket Server and then work with that repo instead. We've got details on how to do that at https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html
Premier Support Engineer
I have seen some customers who already have some external git server but they want the code in these famous Git hosting tools like Bitbucket, and you know what I'm going to say next 😆 Just making a joke there, please don't send this to spam 😉
In this case, if they are strict about what they are following we have the option of mirroring.
If they are willing to change the entire system to Bitbucket, that's good too!!
Christian, thanks for sharing the design model. That certainly makes sense.
To help you understand why I'm asking, our need to switch our Git repository to Bitbucket is causing a bit of a kerfuffle in our NASA group with its rigid security plans.
Pointing Bitbucket to an external repository in order to get all of the benefits of Bitbucket aside from hosting might not be a frequent requirement, but it is important in our case.
Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events