Last active
August 26, 2024 00:06
-
-
Save keepitsimple/41f41d2c768cf94c8b96db9c27c2dda8 to your computer and use it in GitHub Desktop.
Bitbucket pipeline to sync / copy code commits to GitHub. How to sync Bitbucket repo to GitHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: alpine/git:1.0.26 | |
definitions: | |
services: | |
docker: | |
memory: 1024 | |
steps: | |
- step: &Push-to-GitHub | |
name: Push code changes to GitHub | |
services: | |
- docker | |
caches: | |
- docker | |
script: | |
- git remote add github "[email protected]:[yourname]/[your repo].git" | |
- git checkout $BITBUCKET_BRANCH | |
- git pull | |
- git push github $BITBUCKET_BRANCH | |
pipelines: | |
branches: | |
master: | |
- step: *Push-to-GitHub | |
sandbox: | |
- step: *Push-to-GitHub | |
staging: | |
- step: *Push-to-GitHub | |
production: | |
- step: *Push-to-GitHub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It needs to generate SSH key pair in your BitBucket account and to register the public ssh key in your GitHub repo settings as Deployment key ( set [x] for write access)