Import into github from gitorious?

后端 未结 4 438
旧时难觅i
旧时难觅i 2021-02-04 12:15

Has anyone tried or figured out how to import a gitorious repo into github? I already use github and wanted to see if there was a way to pull from a gitorious repo that I wanted

4条回答
  •  借酒劲吻你
    2021-02-04 12:40

    The answers already given will just import master - if you want to import the entire repo including all branches, tags, etc, you need to do the following:

    • Create a blank github repo
    • Clone the gitorious repo using the --bare flag - this preserves all branches/tags and doesn't create a working copy:

      $ git clone --bare git://gitorious.org/USER/REPO.git
      
    • Change directory into the local repo:

      $ cd therepo.git
      
    • Push the repo to github using the --mirror flag - this copies all branches, tags, history etc.:

      $ git push --mirror git@github.com:USER/REPO.git
      
    • Remove the local copy - you don't need it anymore and it's not much use for anything

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

    Once you've done that, you can switch any local repos using the git remote rm/add commands as given above.

提交回复
热议问题