导入到GitHub的从gitorious?(Import into github from gito

2019-07-29 11:09发布

有没有人尝试或想出如何导入gitorious回购到github上? 我已经使用github上,想看看是否有从,我想跟着进入github上一个gitorious回购拉的方式。

Answer 1:

这怎么会是从创建在Github存储库的常规方法有什么不同?

  1. 克隆从gitorious库
  2. 创建新仓库
  3. 按库高达github上

Github上并不关心中,仓库从摆在首位来了,它只是接受任何你推到它。



Answer 2:

您创建新仓库后,立即将该网站为您提供了3个优雅个性化的指令集。 在3个不同的选项有:

  1. 启动一个全新的项目工作
  2. 按现有的Git仓库 -这是你想要的
  3. 按现有的SVN仓库

如果我的用户名是user1和新的回购被称为PROJECT1,这里是它会说什么:

现有的Git回购?

cd existing_git_repo
git remote add origin git@github.com:user1/project1.git
git push -u origin master


Answer 3:

已经给出的答案将只需要导入主 - 如果你想导入整个回购在内的所有分支,标签等,你需要做到以下几点:

  • 创建一个空白GitHub库
  • 使用--bare标志克隆gitorious回购 - 这会保留所有的分支/标签和不创建一个工作副本:

     $ git clone --bare git://gitorious.org/USER/REPO.git 
  • 更改目录到本地回购:

     $ cd therepo.git 
  • 按回购使用--mirror标志github上 - 这将复制所有分支,标签,历史等:

     $ git push --mirror git@github.com:USER/REPO.git 
  • 删除本地副本 - 你不需要它了,它不是任何东西多用

     $ cd .. && rm -rf therepo.git 

一旦你做到了这一点,你可以使用任何切换本地回购git remote rm/add上面给出的命令。



Answer 4:

以前的答案是正确的,但这里的一步,包括从脱钩的Gitorious本地副本的缺失一步一步的过程; 没有它,你会得到错误fatal: remote origin already exists ,当您尝试添加Github上作为新的原点。

  1. 建立在Github空的目标回购
  2. 克隆回购从Gitorious当地
  3. 删除Gitorious为原点
  4. Github上添加新的原点
  5. 推到Github上

命令:

git clone git://gitorious.org/USER/REPO.git
cd REPO
git remote rm origin
git remote add origin https://github.com/USER/REPO.git
git push --mirror https://github.com/USER/REPO.git

你显然需要替换用户和REPO,当你创建你的GitHub库提供了你在步骤1之后的最后两个命令。



文章来源: Import into github from gitorious?