Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with SourceTree while cloning a GitHub repository

I know that similar question is already posted here, however I think that my scenario is a bit different. Here is what I have.

I downloaded and installed the latest official version of the SourceTree software. Also, I have GitHub account with permissions to clone and push the repository. In order to manage a local copy I need to clone the on-line version. Here are the steps that I take:

  1. Start the SourceTree and navigate to File -> Clone / New ...
  2. In the opened window I paste the HTTPS clone URL. I copied it from the browser after I logged-in my GitHub account, so the link is correct.
  3. The nest step is to specify a local folder where the repository will be copied. But when I click to enter Destination Path, the window shows an error:

    This is not a valid source path / URL

    clicking the error may give the details:

    remote: Repository not found. fatal: repository 'https://github.com/org/repo.git/' not found remote: Repository not found. fatal: repository 'https://github.com/org/repo.git/' not found 

Or, the Details may be empty. The SourceTree does not tell me the reason for the error or anything else.

I tried to re-install the SourceTree but the error still exists. I asked the Administration of the GitHub repository for any other permissions but my account has all of them. I am able to push changes to the online repository using the Terminal console, but I would like to use UI (that SourceTree provides) to manage and compare changes in the code.

One think I did not try is to Clone the repository using another GtHub account. But I don't want to do that because I need to commit any changes to the repository on my behalf.

Does anybody know how can this error be fixed or worked around?

like image 234
Pavel Pavlov Avatar asked Dec 21 '13 10:12

Pavel Pavlov


People also ask

Can clone GitHub repo SourceTree?

If you have an existing remote repository on Bitbucket or Github, you need to copy or clone it to your computer. From SourceTree, click Remote. All of your remote projects display. Click Clone next to the repository you wish to clone locally.

Is SourceTree compatible with GitHub?

For instance, you can start by creating a project on Github and then connect it to your SourceTree software so that later on, when you update your code or include new code you can upload the data on Github using SourceTree. To start work with SourceTree, create new project on GitHub (click 'Start a Project'.)

What would happen if you cloned an existing Git repository?

When you clone a repository, you copy the repository from GitHub.com to your local machine. Cloning a repository pulls down a full copy of all the repository data that GitHub.com has at that point in time, including all versions of every file and folder for the project.


2 Answers

I was facing the same issue in Sourcetree for macOS:

This is not a valid source path / URL

This is not a valid source path / URL

The following solution worked for me:

  1. Sourcetree > Preferences > Advanced
  2. Remove the Host name
  3. Clone the project again in Sourcetree
  4. A prompt will pop up; enter your git credentials.

That's it, it resolved my issue.

like image 158
Vikash Sinha Avatar answered Sep 22 '22 15:09

Vikash Sinha


The exact error message is (as illustrated here):

 This is not a valid source path / URL 

error message in sourcetree

Possible cause:

  • proxy settings (as in this thread)
  • setup steps, with Git disabled (as in here)

    When SourceTree started for the first time, I skipped setting up Git & Mercurial in the wizard. Then I reran the wizard and chose to download and install the embedded packages.
    But it seems installing those didn't actually enable them - in the Tools -> Options dialogue they were both disabled!
    Enabling Mercurial (or Git in your case) allowed the clone dialogue to correctly identify the repo.

  • credential issues (as in here, from my old answwer)
like image 35
VonC Avatar answered Sep 19 '22 15:09

VonC