No repos at my app. Check URL, try again

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

  1. Go to GitHub.
  2. Enter “Your old repository’s clone URL” with the Heroku app URL: https://damp-sands-09329.herokuapp.com/.
  3. Observe the error message.

Expected Result

The repository should be imported to GitHub without an error.

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:

  1. Clone the Heroku repository to your local machine using Git:

    git clone https://damp-sands-09329.herokuapp.com/
    
  2. Change into the cloned repository directory:

    cd repository-name
    
  3. Initialize Git in the directory:

    git init
    
  4. 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.

  5. 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.