git迁移仓库方法

最近频繁在尝试托管git服务,免不了各种迁移,不同的git产品也是给出了各种不同的迁移思路,在这里集中整理一下。

下面这种的思路是把原仓库命名为old-origin,再把新仓库加为origin,这样可以随时从旧仓库拉下最新版,然后推到新仓库,即使有人没有及时迁移过来也问题不大。后面确认无误之后再把old-origin删掉即可。是我推荐的一种方式。

cd existing_repo
git remote rename origin old-origin
git remote add origin [email protected]:example/new.git
git push -u origin --all
git push -u origin --tags

这是另一种完全不同的思路,是把远程仓库当做镜像下载过来,再推到新仓库。私以为这是最完整的迁移方式(没有考究),不过我操作还是失败了,因为我们使用过merge request ,会有merge request标签,旧仓库的MR标签跟新仓库的可能不兼容,因此没有成功。最完整的方式但有可能出现兼容问题。推了老半天结果告送我失败了还是有点沮丧。这种方式可能更适合备份恢复。

git clone --bare https://git.example.com/your/project.git your_path
cd your_path
git remote set-url origin [email protected]:example/new.git
git push --mirror

这种其实不是迁移仓库了,如果你觉得仓库有点臃肿,而且提交进了许多无用的东西。同时又不是很需要查找历史提交,可以试试这种方式,就是把代码拎出来重新初始化一个新仓库。偶尔需要查找历史提交可以回旧仓库查找,咱们做迁移,不一定就得把旧的仓库抹掉不是。

cd existing_folder
git init
git remote add origin [email protected]:example/new.git
git add .
git commit
git push -u origin master

144人评论了“git迁移仓库方法”

  1. Pingback: online roulette pay

  2. Pingback: best price on viagra 100mg

  3. Pingback: cialis viagra

  4. Pingback: cialis 10mg for sale

  5. Pingback: buy viagra 25mg online

  6. Pingback: meritking

  7. Pingback: elexusbet

  8. Pingback: meritking

  9. Pingback: meritroyalbet

  10. Pingback: eurocasino

  11. Pingback: meritroyalbet

  12. Pingback: which viagra is best for male

  13. Pingback: australian slots download games

  14. Pingback: meritroyalbet

  15. Pingback: sildenafil over counter

  16. Pingback: viagra daily

  17. Pingback: cialis pills 5mg

  18. Pingback: sildenafil 25mg price

  19. Pingback: cialis cost cvs

  20. Pingback: tadalafil 30mg tablet

  21. Pingback: generic tadalafil australia

  22. Pingback: madribet

  23. Pingback: legitimate canadian pharmacies online

  24. Pingback: viagra free sample

  25. Pingback: eurocasino

  26. Pingback: zithromax 1g

  27. Pingback: perabet

  28. Pingback: pics of viagra pills

  29. Pingback: madridbet

  30. Pingback: ivermectin price comparison

  31. Pingback: elexusbet

  32. Pingback: ventolin evohaler buy

  33. Pingback: ivermectin 9mg

  34. Pingback: generic cialis over the counter

  35. Pingback: viagra pills prescription

  36. Pingback: sildenafil warnings

  37. Pingback: stromectol preis

  38. Pingback: ivermectin lotion price

  39. Pingback: trcasino

  40. Pingback: albuterol 2mg capsules

  41. Pingback: tombala siteleri

  42. Pingback: fcccc

  43. Pingback: imask protocol flccc

  44. Pingback: meritroyalbet

  45. Pingback: ivermectine buy

  46. Pingback: ivermectin nz

  47. Pingback: stromectol medicine

  48. Pingback: stromectol lotion

  49. Pingback: ivermectin for sale

  50. Pingback: ivermectin australia

  51. Pingback: ivermectin online

  52. Pingback: ivermectin ontario

  53. Pingback: cialis generic

  54. Pingback: prednisone 20mg pill

  55. Pingback: buy tadalafil powder

  56. Pingback: tadalafil online purchase

  57. Pingback: provigil online

  58. Pingback: ivermectin 50ml

  59. Pingback: viagra and cialis for sale

  60. Pingback: cialis goodrx

  61. Pingback: hims viagra

  62. Pingback: 10mg cialis cost

  63. Pingback: cialis without doctor

  64. Pingback: where can i buy oral ivermectin

  65. Pingback: comprar cialis

  66. Pingback: cialis canadian pharmacy

  67. Pingback: get cialis

  68. Pingback: tadalafil uses

  69. Pingback: sildenafil pills generic brand

  70. Pingback: buy cialis

  71. Pingback: stromectol pill price

  72. Pingback: hvordan virker viagra

  73. Pingback: sildenafil pills

  74. Pingback: sildenafil pills

  75. Pingback: tadalafil and dapoxetine

  76. Pingback: viagra cialis levitra

  77. Pingback: tadalafil mexico

  78. Pingback: prednisone 20mg for eczema

  79. Pingback: thuoc prednisone 20mg

  80. Pingback: covid pill vaccine

  81. Pingback: 1carving

  82. Pingback: cialis going generic

  83. Pingback: child porn

  84. Pingback: stromectol coronavirus

  85. Pingback: cvs viagra

  86. Pingback: steroid side effects

  87. Pingback: what is cialis

  88. Pingback: win real money casino

  89. Pingback: order real viagra online

  90. Pingback: stromectol oral

  91. Pingback: cialis price walmart

  92. Pingback: ivermectin 3mg tablets

  93. Pingback: cialis cost 20mg

  94. Pingback: cheap generic viagra online pharmacy

  95. Pingback: cialis coupon

  96. Pingback: keflex medicine

  97. Pingback: keflex sjs

  98. Pingback: cephalexin gonorrhea

  99. Pingback: ivermectin for humans dosage

  100. Pingback: best place to buy 20 mg cialis

  101. Pingback: how to get ivermectin in canada

  102. Pingback: stromectol at

  103. Pingback: ivermectin no prescription

  104. Pingback: metronidazole odor

  105. Pingback: ivermectin 0.08%

  106. Pingback: azithromycin

  107. Pingback: omnicef uti

  108. Pingback: online cialis coupon

  109. Pingback: clarithromycin

  110. Pingback: azithromycin blue

  111. Pingback: celebrex costs

  112. Pingback: price of ivermectin tablets

  113. Pingback: how much does ivermectin cost

  114. Pingback: meritroyalbet

  115. Pingback: meritking

  116. Pingback: meritking

  117. Pingback: lasix 40 mg buy

  118. Pingback: trcasino

  119. Pingback: buy lasix on line

  120. Pingback: ivermectin 3mg for lice

  121. Pingback: side effects for ivermectin

  122. Pingback: eurocasino

  123. Pingback: eurocasino

  124. Pingback: stromectol pill for humans

  125. Pingback: side effects of ivermectin in humans

  126. Pingback: generic tadalafil

  127. Pingback: ivermectin cost

  128. Pingback: madridbet

  129. Pingback: ivermectin uk

  130. Pingback: dengue ivermectin

  131. Pingback: stromectol price uk

  132. Pingback: meritroyalbet

  133. Pingback: eurocasino

  134. Pingback: where to buy stromectol online

  135. Pingback: purchase stromectol online

  136. Pingback: stromectol medication

  137. Pingback: child porn

  138. Pingback: ivermectin for humans cvs

  139. Pingback: ivermectin 8000 mcg

  140. Pingback: bahis siteleri

  141. Pingback: meritroyalbet

  142. Pingback: A片

  143. Pingback: pornoizle}

  144. Pingback: meriking

发表评论