user github and bitbucket : paul
Github git repo : https://github.com/paul/app1
Bitbucket git repo : https://bitbucket.org/paul/app1
clone github repo
$git clone https://github.com/paul/app1.git
$cd app1
create new 'sync' branch and switch on it
$git checkout -b sync
$git branch
add new remote repo under name 'bitbucket'
$git remote add bitbucket https://bitbucket.org/paul/app1
$git remote -v
push the content of the sync branch on a new sync branch in 'bitbucket' repository
$git push -u bitbucket sync
Now do some change in 'sync' branch
to push changes in bitbucket just do
$git status
$git push
to update the github version
$git checkout master
$git branch
$git pull
to merge change (put sync branch content into master branch content)
$git checkout master
$git branch
$git merge sync
$git status
push any change to github
$git checkout master
$git branch
$git push
$git status
NOTE : https://gist.github.com/jcaraballo/1982605
Aucun commentaire:
Enregistrer un commentaire