Idell40
(Idell Ebert)
January 1, 2020, 1:47pm
1
Issue: Unable to Import GitHub Repository
I’m trying to import a repository from Heroku to GitHub but I’m getting an error message.
Error Message
No source repositories were detected at https://damp-sands-09329.herokuapp.com/ . Please check the URL and try again.
Steps to Reproduce
Go to GitHub .
Enter “Your old repository’s clone URL” with the Heroku app URL: https://damp-sands-09329.herokuapp.com/ .
Observe the error message.
Expected Result
The repository should be imported to GitHub without an error.
Major7
(Major McClure)
January 1, 2020, 10:34pm
2
Answer
The error message suggests that the specified URL is not a valid repository URL. Heroku is a hosting platform and not a version control system like GitHub. To import a repository from Heroku, you need to first clone the repository from Heroku to your local machine using Git and then push it to GitHub.
To do this, follow these steps:
Clone the Heroku repository to your local machine using Git:
git clone https://damp-sands-09329.herokuapp.com/
Change into the cloned repository directory:
cd repository-name
Initialize Git in the directory:
git init
Add the GitHub repository as a remote:
git remote add origin https://github.com/your-username/your-repository.git
Replace your-username
and your-repository
with your GitHub username and the name of the repository you want to create on GitHub.
Push the code to GitHub:
git push -u origin master
This will push the code to GitHub and create a new repository with the specified name.
After following these steps, your repository should be successfully imported to GitHub.