ent*_*pid 155 git github bitbucket
我正在开发一个基于CakePHP的项目,该项目托管在GitHub上.我的项目正在Bitbucket上托管.他们俩都使用git.基本上我想在我的Bitbucket存储库中创建一个'fork'(我不知道我是否使用了正确的术语,因为我是git的新手)CakePHP,以便能够获得更新无需下载所有CakePHP zip/tar并替换文件夹,然后提交并推送,但可能使用'merge'(?).
谢谢!
Mar*_*ler 140
今天不可能在不同的网站上发送"拉取请求".我在Bitbucket问题跟踪器中添加了一个功能请求:#3288.如果你想追踪这个,我建议你把自己添加为追随者.
但是,您仍然可以将源从GitHub移动到Bitbucket,而无需下载任何zip文件或tarball.你从GitHub克隆并推送到Bitbucket:
$ git clone https://github.com/cakephp/cakephp
$ cd cakephp
$ git push git@bitbucket.org:mg/cakephp.git master
Run Code Online (Sandbox Code Playgroud)
我mg/cakephp首先在Bitbucket中创建了一个空的Git存储库.这样你就可以将变换集从GitHub推送/拉到Bitbucket.
ale*_*emb 79
下面的工作流程将github存储库添加为一个新的远程调用sync和bitbucket远程调用origin.它还添加了一个名为github跟踪github存储库的分支和一个名为master跟踪bitbucket存储库的分支.它假设你有一个名为"myrepository"的bitbucket存储库,它是空的.
# 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
Run Code Online (Sandbox Code Playgroud)
# 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
Run Code Online (Sandbox Code Playgroud)
现在你应该让本地github分支跟踪github repo的master分支.你应该让本地master分支跟踪bitbucket repo(master默认为分支).
这样可以很容易地对github分支进行拉动,然后将这些更改合并到master分支上(虽然优先选择rebase),然后你可以推动master分支(将它推到bitbucket).
Zub*_*bin 29
如果你想让你的repo保持最新,请使用两个遥控器:Github(upstream)和Bitbucket(origin)如下:
# 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
Run Code Online (Sandbox Code Playgroud)
从Github获取CakePHP的更新:
git pull upstream master
Run Code Online (Sandbox Code Playgroud)
将代码更改推送到Bitbucket:
git push origin master
Run Code Online (Sandbox Code Playgroud)
shm*_*uli 15
在BitBucket中创建新存储库时,单击右上角的按钮Import repository.输入Clone or download在Github中单击要分叉的存储库时找到的https url .
为您的存储库命名,配置您的隐私设置,然后就可以了!
小智 5
我注意到自从 @Martin Geisler 的回答以来,Bitbucket 启用了从 github.com 导入存储库的功能
我能够成功将 github.com 上的私有存储库导入到 bitbucket.org 上的私有存储库中
步骤如下:
| 归档时间: |
|
| 查看次数: |
57724 次 |
| 最近记录: |