Reputation: 831
I had a repository hosted on bitbucket cloud which I copied to bitbucket server instance using https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html
I used "Import an existing Git project into Bitbucket Server" method in the above URL.
Now, there are some updates made on the cloud repository (new branches, commits etc.) which I want to move to my Bitbucket server repository. How can I do that ?
One method I can think of is: - clone bitbucket server repository - add bitbucket cloud repo as new remote - pull changes from bitbucket cloud repo - push changes to bitbucket server repo
But the problem with above method is while pulling changes from bitbucket cloud repo, I don't know which branches to pull. I want all branches and commits to be synced.
Any pointers will be helpful.
Upvotes: 2
Views: 11942
Reputation: 4075
You might try one of the mirroring/sync related add-ons available on the Atlassian Marketplace. A couple of them are for outbound mirroring (pushing changes to a remote). I do know that ScriptRunner supports inbound mirroring.
Alternatively, as you describe you could externally manage syncing by having a clone with 2 remotes where you pull all changes from the cloud host and push them to the Bitbucket Server instance, and that could then be automated on a schedule or trigger.
Upvotes: 2