Importing private repo to other private repo Git
Asked Answered
C

5

33

I have a private repo on git that I would love to import in another private repo. 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. continue to pop up and I cannot import the repo. Someone could help?

Clarkson answered 18/2, 2022 at 18:39 Comment(1)
This example should helps to you.Formidable
C
33

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

Chessa answered 16/3, 2022 at 16:27 Comment(2)
Here are the steps: 1. go to github.com/settings/tokens 2. click on generate new token button that is located on top right 3. write any description, and preferably set it to 7 days 4. now it is generated, copy that string and go to the importing page. enter your username to the username field, and the key that you've copied to the password field.Newborn
I already had a token that I had generated about a year ago and that worked fine also. Just username and then paste the token in instead of your normal password.Viniculture
P
27

If you're importing a private repo from Bitbucket to GitHub, you need to create a new App Password with read-only access for GitHub to import the repo.

Steps :

  1. In your Bitbucket, go to "Personal settings".
  2. Under "Access Management", select "App passwords".
  3. Click "Create app password".
  4. Give it a label, select the relevant fields for your usage, then click "Create".
  5. Save the password somewhere safe & secure, because Bitbucket will never show you again.
  6. Use the newly created app password along with your Bitbucket username to log in and import the repo on GitHub.

It is recommended to revoke the app password once you're done using it.

Phonology answered 20/8, 2022 at 12:42 Comment(5)
This is the only answer which worked for me. I was importing from BitBucket to Github. ThanksMilreis
Use your bitbucket username and newly created app password for Github Repository Import from Bitbucket.Garibold
Another crucial thing to note: At step 4., "relevant" fields not only includes read access to the project but also the account (!) (I was missing account read access first - and it didnt work). At step 6. use the bitbucket username only plus the password from step 3.Diaspore
@hennzen, your comment helped me a lot. It should be added to the answer. Thank you!Oreilly
this works 2023Opportunism
K
17

I had the same issue.

It was resolved when I used my username for my Bitbucket account instead of my email.

I also used an app password instead of my regular password.

Katlynkatmai answered 7/1, 2023 at 6:34 Comment(1)
This was the difference maker. I was under the impression that my email WAS my username, but when I clicked the gear in the top right of BitBucket, selected Personal Settings, and then Account Settings, it listed my username. Using that plus creating a new App Password in the same area was what worked for me.Considerable
H
7

Use a Personal Access Token (in place of the password) - direct link to create one: 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).

Hadwyn answered 22/9, 2022 at 8:56 Comment(0)
R
0

For Login: give your git username

For the Token: go to settings->developer settings -> Personal Access Tokens -> Generate a new token with permissions to the needed repo.

This worked for me.

Replica answered 31/1 at 7:27 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Designer

© 2022 - 2024 — McMap. All rights reserved.