You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将GitHub仓库转移至组织?无权限登录目标组织的转移方案

解决GitHub仓库转移权限报错与Issue迁移方案

Alright, let's break down your problem step by step—you've got two core goals here: moving your personal repo to your team's GitHub org, setting that new repo to hold only the issues from your existing team repo, while making the original repo private. Let's tackle that permission error first, since it's blocking your progress right now.

一、Fixing the "Permission to create public repositories" Error

That error message You don’t have the permission to create public repositories on [groupname] usually boils down to two common issues, each with a straightforward fix:

1. You accidentally tried to transfer a public repo (but you meant private)

If your new issue-only repo is supposed to be private (which makes sense, since you're locking down the original repo), double-check the visibility setting when you initiate the transfer. A lot of folks miss this—GitHub defaults to public for new/transferred repos, and many orgs restrict regular members from creating public repos. Switching the visibility to private before transferring should resolve this if that's the root cause.

2. Your org role doesn't allow repo creation/transfer

By default, GitHub's "Member" role in an org doesn't grant permission to create or transfer private repos into the org. You have two options here:

  • Ask your org admin to upgrade your role: Request they change your role to "Maintainer" (this is sufficient—no need for full "Owner" access). Maintainers can create and transfer private repos to the org without issues.
  • Have an admin handle the transfer for you: Either ask the admin to create a blank private repo directly in the org, then you can import the issues into it, or temporarily grant them transfer access to your personal repo so they can move it over.

二、Migrating Issues from the Original Repo to the New One

Once you've sorted out the permission problem, getting all your original issues into the new org repo is straightforward with these methods:

1. Use GitHub's Built-in Issue Importer

GitHub has a native tool for this, no third-party apps needed:

  • Go to your new blank org repo, navigate to the Issues tab.
  • Look for the "Import issues" option (if you don't see it, check with your admin—they might need to enable it, or you might need Maintainer access).
  • Select your original repo as the source, check the box to import all issues (you can filter specific ones if needed), and let GitHub handle the rest.
  • Note: This preserves issue titles, descriptions, comments, labels, and statuses. Your original repo's issues won't be deleted—you can just set that repo to private later to restrict access.

2. Use GitHub API Scripts (If the Importer Isn't Working)

If the native importer is blocked for some reason (e.g., permission limits), you can use a simple script to copy issues via the GitHub API. The basic workflow is:

  • Write a small script (Python works great for this) to fetch all issues (including comments) from your original repo.
  • Use the API to create matching issues in the new org repo, copying over all relevant details.
  • You'll need read access to the original repo and write access to the new one, but there are plenty of open-source scripts you can adapt to your needs (no need to reinvent the wheel).

三、Final Step-by-Step Checklist

  1. Confirm your personal repo is set to private before attempting to transfer it to the org (or have the admin create a private repo in the org first).
  2. Get your org role upgraded to Maintainer, or ask an admin to help with the repo transfer/creation.
  3. Use GitHub's issue importer to move all issues from the original repo to the new org repo.
  4. Go to your original repo's settings and change its visibility to private (you have admin access, so this should be easy).

That's it—you'll end up with a private original repo, and a dedicated org repo holding all your original issues, exactly what you wanted.

内容的提问来源于stack exchange,提问作者Nigel Flower

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 07:37:16