10

As you know GitHub has introduced a Repo Transfer feature. https://github.com/blog/876-repo-transfers This allows you to change ownership of your root repos, not forking them with your organization. However, if you have already forked a repo and want to dump all its open issues to newly created one, what should you do?

Is there any solution on GitHub-2-GitHub issues import?

maxk
  • 642
  • 1
  • 9
  • 21

4 Answers4

14

Though Tekkub answer makes sense, I still implemented a short script to transfer issues: github.com/..../gh-issues-import

KindDragon
  • 6,558
  • 4
  • 47
  • 75
maxk
  • 642
  • 1
  • 9
  • 21
6

You should delete the newly created one and transfer the repo instead. Transferring repo ownership takes the issues with it.

Tekkub
  • 30,739
  • 2
  • 30
  • 20
5

Tekkub wrote a not-so-well-received answer (-2 as of this writing): "You should delete the newly created one and transfer the repo instead. Transferring repo ownership takes the issues with it." He isn't wrong; he just didn't walk through any of the considerations and gotchas. I'll enumerate a few of those below ...

Only Works if you have "admin" access to the parent repo:

In my case, I couldn't use repo-migration because I don't "own" the parent repo so I can't authorize the transfer (parent repo in the hands of a team-member who left). So it doesn't work for me. HOWEVER ... if you do in fact have admin privileges to the parent repo you are migrating, then using the "transfer repo" function is distinctly better and nowhere near as hard as it sounds.

Git history - trivial to keep

One of the commenters expressed concern over the new repo having its own history they don't want to lose. Well, that's the magic of git as a distributed VCS. You simply pull down all branches and tags and everything else to your local repo and then push that history up to the repo you are going to migrate.

git remote add origin1 https://github.com/blah/blah
git remote add origin2 https://github.com/blah/blah
git pull origin1
git push origin2

If you've created issues in both repos ... well that's screwed

Decide which repo has more important content, use that as the base, and port everything else into there. It's a "merge". good luck. The gh-issues-import.py script script posted by ibo.ezhe helps, but it doesn't restore comments on the issues. Feel free to improve it and send him a PullRequest (I did).

Community
  • 1
  • 1
Dave Dopson
  • 41,600
  • 19
  • 95
  • 85
0

There's a Chrome Extension called Kamino that my colleague wrote. It's open source, and works extraordinarily well. It's more for copying issues individually, but he's looking at doing bulk copies as well.

Available here: https://chrome.google.com/webstore/detail/kamino/ffdebockfdjileaojbbccofhgncmioaf Source code: http://github.com/gatewayapps/kamino

Daniel Gary
  • 507
  • 4
  • 10