Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub-2-GitHub issues import

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?

like image 375
ibo.ezhe Avatar asked Jun 15 '11 10:06

ibo.ezhe


1 Answers

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).

like image 146
Dave Dopson Avatar answered Oct 04 '22 06:10

Dave Dopson