Forking from GitHub to Bitbucket

后端 未结 6 1519
渐次进展
渐次进展 2020-12-22 14:32

I\'m working on a project based on CakePHP, that\'s hosted on GitHub. My project is being hosted on Bitbucket

6条回答
  •  感情败类
    2020-12-22 15:35

    If you want to keep your repo up to date, use two remotes: Github (upstream) and Bitbucket (origin) like this:

    # Clone original CakePHP source code from Github
    git clone --mirror https://github.com/cakephp/cakephp
    cd cakephp
    # Rename remote from `origin` to `upstream`
    git remote rename origin upstream
    # Add your Bitbucket repo (this is where your code will be pushed)
    git remote add origin https://bitbucket/your/repo.git
    # Push everything to Bitbucket
    git push --mirror origin
    

    To pull updates to CakePHP from Github:

    git pull upstream master
    

    To push your code changes to Bitbucket:

    git push origin master
    

提交回复
热议问题