아래의 워크 플로는 github 리포지토리를 새로운 원격이라고 sync하고 bitbucket 원격을로 추가 origin합니다. 또한 githubgithub 리포지토리 master를 추적하기 위해 호출되는 분기와 비트 버킷 리포지토리를 추적하기 위해 호출되는 분기를 추가 합니다. 비어있는 "myrepository"라는 비트 버킷 저장소가 있다고 가정합니다.
리모컨 설정
# 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
설치 지점
# 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
이제 로컬 github브랜치가 github repo의 master브랜치를 추적 해야합니다 . 그리고 로컬 master브랜치가 비트 버킷 저장소 ( master기본적으로 브랜치)를 추적 해야합니다 .
이렇게하면 github브랜치를 쉽게 가져온 다음 변경 사항을 master브랜치에 병합하고 (병합보다 우선 적용) master브랜치를 푸시 (비트 버킷으로 푸시) 할 수 있습니다 .