Import Repository not working

Hi all,

I’ve been trying to use the import tool (https://github.com/new/import) to import the code from an existing GitHub repo into a newly created one.

Each time, it will start up, then give the message asking for credentials:

“Your old project requires credentials for  read-only access. We will only temporarily store them for importing.”

Once I type in the credentials, it goes back to the screen showing the progress, but never advances. It then asks for credentials again after a while. This just repeats until I press “Cancel”. 

The repo to import is private and the new repo will be private as well. Am I doing something wrong on my end? Maybe I’m not getting the right clone URL? I’ve tried both https://github.com/JohnPollockMIC/reponame and https://github.com/JohnPollockMIC/reponame.git

Thanks!

John

1 Like

For privacy and security reasons, we don’t have access to private account details, including the contents or details of private repositories. If you contact private support at https://github.com/contact, they should be able to investigate what might be going on with the import tool and help you out.

On the other hand, if you just want to migrate the code across you can use the following commands on the command line to do the migration by hand:

git clone https://github.com/JohnPollockMIC/old-repo.git
cd reponame
git remote add new-repo https://github.com/JohnPollockMIC/new-repo.git
git push new-repo master

You have to create the new repository before you execute the above list of commands.

I hope that helps!

I ran into this same thing and it was because I have two-factor authentication enabled on my account. You can get by this by generating a personal access token.

7 Likes

I also just briefly changed my repository from ‘private’ to ‘public’ and the ‘import code’ worked just fine. Just another alternative fix! 

1 Like

This worked for me. Thanks!

This was the exact issue stopping me from importing from a private repo.

When you set up the Personal Access Token, you’ll need to check the box giving the token access to Private Repositories.

After generating the token, try the import again using the token as your password.

Hi,

My case is slightly different.

I’m getting the same error.

Source: ‘GIT’ repository (on azure devops)

source url for repo:"

https://companyname.visualstudio.com/source-repo

"

Destination: 'GIT HUB’  repository.

destination url for repo: 

https://github.com/companyname/dest-repo

I tried the steps provided by ‘lee-dohm’ but get the error ‘error: src refspec master does not match any’

The easier option to change it to public.

I don’t know whether the source repository (GIT) is private or not.  How do i check and change it. 

Any help in this regards is appreciated.

Thanks

Suga