2

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.

Vikas Mangal
  • 821
  • 3
  • 10
  • 23
  • maybe this helps: [http://stackoverflow.com/questions/15056327/how-do-i-synchronise-two-remote-git-repositories](http://stackoverflow.com/questions/15056327/how-do-i-synchronise-two-remote-git-repositories) – wot-stefan Sep 29 '16 at 14:38

1 Answers1

2

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.

Rog
  • 4,075
  • 2
  • 24
  • 35