Table of Contents

Sync Git Repo across Cloud Provider

Based on this article. Updated with latest Github requirement of key pair.

On Github Side

  1. Create repo designated as mirror of Bitbucket
  2. Create ssh-ed25519 Keypair for that account, see here
  3. Hold the private and public ready

On Bitbucket Side

  1. Login as Repo Administrator, not just collaborator.
  2. Open the Repository Settings > Settings menu for the given repo.
  3. Enable pipeline for this repository
  4. Open the Repository Settings > SSH Keys
  5. Click “Use my own key”
  6. Put the public and private key of the Github repo account that was created above.
  7. On the Known Host section, enter github.com, then click Fetch. After the site fingerprint fetched, click Add

Bitbucket Pipeline configuration

Use the following example as template. Edit the repo name accordingly.

clone:
  depth: full
pipelines:
  default:
    - step:
        script:
          - git push --mirror git@github.com:semaidevadmin/semai-pro-kuasa-api.git

This will push the changes to the designated Github target. It connects using SSH, with the private key of Github account.