如何从bitbucket到github的所有分支移动git存储库?
本文翻譯自:How to move git repository with all branches from bitbucket to github?
What is the best way to move a git repository with all branches and full history from bitbucket to github? 將所有分支和完整歷史從bitbucket移動(dòng)到github的git存儲(chǔ)庫(kù)的最佳方法是什么? Is there a script or a list of commands I have to use? 是否有腳本或命令列表我必須使用?
#1樓
參考:https://stackoom.com/question/1Y78P/如何從bitbucket到github的所有分支移動(dòng)git存儲(chǔ)庫(kù)
#2樓
You can refer to the GitHub page " Duplicating a repository " 您可以參考GitHub頁(yè)面“ 復(fù)制存儲(chǔ)庫(kù) ”
It uses: 它用:
- git clone --mirror : to clone every references (commits, tags, branches) git clone --mirror :克隆每個(gè)引用(提交,標(biāo)記,分支)
- git push --mirror : to push everything git push --mirror :推送一切
That would give: 這會(huì)給:
git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git # Make a bare mirrored clone of the repositorycd repository-to-mirror.git git remote set-url --push origin https://github.com/exampleuser/mirrored # Set the push location to your mirrorgit push --mirrorAs Noted in the comment s by LS : 正如LS 的評(píng)論中所述 :
- it is easier to use the Import Code feature from GitHub described by MarMass . 使用MarMass描述的GitHub中的Import Code功能更容易。
See https://github.com/new/import 請(qǐng)參閱https://github.com/new/import - Unless ... your repo includes a large file: the problem is, the import tool will fail without a clear error message. 除非 ...你的repo包含一個(gè)大文件:問(wèn)題是,導(dǎo)入工具將失敗而沒(méi)有明確的錯(cuò)誤消息。 Only GitHub Support would be able to diagnose what happened. 只有GitHub支持才能診斷發(fā)生了什么。
#3樓
http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
This helped me move from one git provider to another. 這幫助我從一個(gè)git提供者轉(zhuǎn)移到另一個(gè)。 At the end of it, all the commits were in the destination git. 最后,所有提交都在目標(biāo)git中。 Simple and straight forward. 簡(jiǎn)單直接。
git remote rename origin bitbucket git remote add origin https://github.com/edwardaux/Pipelines.git git push origin masterOnce I was happy that the push had been successful to GitHub, I could delete the old remote by issuing: 一旦我對(duì)GitHub的推送成功感到高興,我可以通過(guò)發(fā)出以下命令刪除舊的遙控器:
git remote rm bitbucket#4樓
It's very simple. 這很簡(jiǎn)單。
1o Create a new empty repository in GitHub (without readme or licesne, you can add them before) and the following screen will show 1o在GitHub中創(chuàng)建一個(gè)新的空存儲(chǔ)庫(kù)(沒(méi)有自述文件或licesne,您可以在之前添加它們),以下屏幕將顯示
2o Inside to import code option you paste your bitbucket URL's repo and voilà!! 2o在里面導(dǎo)入代碼選項(xiàng)你粘貼你的bitbucket URL的repo和voilà!!
#5樓
In case you couldn't find "Import code" button on github, you can: 如果您在github上找不到“導(dǎo)入代碼”按鈕,您可以:
UPDATE: Recently, Github announced the ability to " Import repositories with large files " 更新:最近,Github宣布了“ 導(dǎo)入大文件存儲(chǔ)庫(kù) ”的能力
#6樓
I had the reverse use case of importing an existing repository from github to bitbucket. 我有一個(gè)將現(xiàn)有存儲(chǔ)庫(kù)從github導(dǎo)入bitbucket的反向用例。
Bitbucket offers an Import tool as well. Bitbucket也提供導(dǎo)入工具 。 The only necessary step is to add URL to repository. 唯一必要的步驟是將URL添加到存儲(chǔ)庫(kù)。
It looks like: 看起來(lái)像:
總結(jié)
以上是生活随笔為你收集整理的如何从bitbucket到github的所有分支移动git存储库?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Property description
- 下一篇: fpga驱动rgb液晶屏_用FPGA设计