简体   繁体   English

将私人仓库导入其他私人仓库 Git

[英]Importing private repo to other private repo Git

I have a private repo on git that I would love to import in another private repo.我在 git 上有一个私人仓库,我很想将其导入另一个私人仓库。 When I try to import it, I log in with my account and then this message Your old project requires credentials for read-only access. We will only temporarily store them for importing.当我尝试导入它时,我使用我的帐户登录,然后显示此消息Your old project requires credentials for read-only access. We will only temporarily store them for importing. Your old project requires credentials for read-only access. We will only temporarily store them for importing. continue to pop up and I cannot import the repo.继续弹出,我无法导入回购协议。 Someone could help?有人可以帮忙吗?

I had the same problem and was able to resolve it by using the Personal Access Token (token access to Private Repositories) instead of the password.我遇到了同样的问题,并且能够通过使用个人访问令牌(对私有存储库的令牌访问)而不是密码来解决它。 Take a look at this from the github community which gives a bit more detail (the answer from hobojoe1848):https://github.community/t/import-repository-not-working/2044/4从 github 社区看一下这个,它提供了更多细节(来自 hobojoe1848 的答案):https://github.community/t/import-repository-not-working/2044/4

If you're importing private repo from Bitbucket to Github, you need to create a new App Password with read only access for Github to import the repo.如果您要将私有存储库从 Bitbucket 导入到 Github,则需要为 Github 创建一个具有只读访问权限的新应用程序密码才能导入存储库。

Steps:脚步:

  1. In your Bitbucket, go to "Personal settings".在您的 Bitbucket、go 中设置为“个人设置”。
  2. Under "Access Management", select "App passwords".在“访问管理”下,select“应用程序密码”。
  3. Click "Create app password".点击“创建应用密码”。
  4. Give it a label, select the relevant fields for your usage, then click "Create".给它一个 label, select 相关字段供您使用,然后单击“创建”。
  5. Save the password somewhere safe & secure, because Bitbucket will never show you again.将密码保存在安全可靠的地方,因为 Bitbucket 将永远不会再向您显示。
  6. Use the newly created app password to import the repo on Github.使用新创建的应用密码在 Github 上导入 repo。

It is recommended to revoke the app password once you're done using it.建议您在使用完毕后撤销应用密码。

Use a Personal Access Token (in place of the password) - direct link to create one: https://github.com/settings/tokens/new使用个人访问令牌(代替密码) - 直接链接创建一个: https://github.com/settings/tokens/new

(Inspired by tedel's answer, but 1) the edit queue is full so I can't edit it, and 2) their link is now broken — as well as Adnan's comment). (受 tedel 的回答启发,但 1)编辑队列已满,因此我无法对其进行编辑,以及 2)他们的链接现在已断开 - 以及 Adnan 的评论)。

I had the same issue.我遇到过同样的问题。

It was resolved when I used my username for my Bitbucket account instead of my email.当我使用 Bitbucket 帐户的用户名而不是 email 时,问题得到了解决。

I also used an app password instead of my regular password.我还使用了应用程序密码而不是我的常规密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM