What do i need to do to sync my Bitbucket repo to my Github repo so i can pull changes from one to another?
Hi Francisco,
You can use a modified forking workflow to accomplish this but it won't be automatically synced without a more customized solution. Below is an example of how to sync them manually.
This Stack Overflow question has a good diagram and explanation: https://stackoverflow.com/a/9257901
You can have 1 repository on your local machine and set it up to have multiple remotes. What you would want to do is something like this:
# cd into the folder on your machine
# maybe the origin is set to Github, pull the latest changes
git pull origin master
# set Bitbucket as another remote named 'bitbucket'
git remote add bitbucket git@bitbucket.org:username/repo-name.git
# push the repo to the new remote 'bitbucket'
git push bitbucket master
# now the Bitbucket repo is up-to-date
Now, anytime you make changes and push to Github (origin), you can push to the other remote (bitbucket) to keep them in sync. Again, a more advanced solution would be to use Webhooks to sync them automatically.
Thanks, this helped my a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.