Aşağıdaki iş akışı, github deposunu yeni bir uzaktan kumanda syncve bitbucket uzaktan kumandası olarak ekler origin. Ayrıca githubgithub deposunu izlemek için çağrılan bir dal ve bitbucket deposunu izlemek için çağrılan bir dal ekler master. Boş "myrepository" adında bir bitbucket deponuz olduğunu varsayar.
Kurulum uzaktan kumandaları
# setup local repo
mkdir myrepository
cd myrepository
git init
# add bitbucket remote as "origin"
git remote add origin ssh://git@bitbucket.org/aleemb/myrepository.git
# add github remote as "sync"
git remote add sync https://github.com/aleemb/laravel.git
# verify remotes
git remote -v
# should show fetch/push for "origin" and "sync" remotes
Kurulum dalları
# first pull from github using the "sync" remote
git pull sync
# setup local "github" branch to track "sync" remote's "master" branch
git branch --track github sync/master
# switch to the new branch
git checkout github
# create new master branched out of github branch
git checkout -b master
# push local "master" branch to "origin" remote (bitbucket)
git push -u origin master
Şimdi yerel githubşubenin github repo şubesini izlemesi gerekir master. Ve yerel masterşubenin bitbucket repo'yu izlemesi gerekir ( mastervarsayılan olarak şube).
Bu, githubdalda bir çekmeyi kolaylaştırır , daha sonra bu değişiklikleri masterdalda birleştirir (yine de birleştirme yerine tercih edilen taban) ve daha sonra masterdalı itebilirsiniz (bitbucket'e iter).