Issue with SourceTree while cloning a GitHub repository

Viewed 124930

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?

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

Lastly on Mac I went to

Sourcetree->Preferences->Git->Git version->Use System Git

and it works... puf!

So I'm here in 2021. Previous answers didn't work for me. There is an issue with a SourceTree (to be honest a lot of issues actually) and as a workaround you can use a token as a password to connect to GitHub.

Use this url to create it: https://github.com/settings/tokens I hope it helps!

I was facing the same issue in mac. The following solution worked for me :

  1. Generate personal access token in Github using the following steps : Login to Github account -> Settings -> Developer Settings -> Personal access tokens -> Generate new token -> Enter token name -> Generate token
  2. Sourcetree > Preferences > Advanced
  3. Remove the Host name
  4. Clone the project again in Sourcetree
  5. A prompt will pop up; enter your git credentials. (enter username and in password enter newly generated access token) After following this steps, Clone option will get enabled

Even tried all the options above, It quite dint work for me.

  • I disable the option of ssl certificate

steps :

Go to Tools -> Options -> Git. check the box of "Disable SSL certificate validation"

It worked for me.

Open source tree Tools -> Options -> Git -> Update Embedded. While updating it will ask your gitlab account for linking. After that restart your system.

Adding my scenario and solution:

I have two factor authentication turned on. I couldn't see some private repositories, and couldn't clone from URL. The error I saw was:

remote: Repository not found.
fatal: repository 'https://github.com/bizzabo/web-common.git/' not found
remote: Repository not found.
fatal: repository 'https://github.com/bizzabo/web-common.git/' not found

Supposedly newer versions of SourceTree don't need a personal access token because they can authenticate directly with github, but I couldn't get this to work.

Apparently OAuth and 2FA don't mix well together -- so I changed the authentication method from oauth to basic and used the access token I generated. That did it.

Just in case someone who has multiple git accounts connected and faces this issue, I solved it by going to Tools > Options > Authentication and marking the account which has access to the repo you are trying to clone as default.

Install git to your system by browser and then go to the source tree, click on Tools -> Options -> Git then scroll down and click on system. It works for me, I hope for you too.

I had the same problem. My resolution was to commit an initial file into the repo. After that, I could clone the repo to my desktop.

options -->Tools--->disable ssh worked for me in Mac

If you are using Mac and there is Keychain access handling all your authentication, then delete the entry for stash/git url. Now try to checkout in sourcetree and it will ask to enter the password again.

That will solve your problem.

I face this issue on Windows 11 and following are the steps worked for me :

  • Click on Open with GitHub Desktop option [Refer below image] enter image description here
  • Download & install
  • Launch and click on Open in browser with Github.com
  • Enter your credentials & validate
  • Now, Open SourceTree
  • Click on Tools > Options > Authentication
  • You will see your Git credentials were successfully added in SourceTree & you can proceed with any option like clone repo etc

I was trying to clone a project from gitlab. However, I have cloned gitlab projects earlier with an account/user credentials which is different from the new account I want to use. In this case, I had deleted the credentials for the old account and then I was able to clone the project by entering credentials for the new gitlab account. To delete the account on MAC go to Preferences > Advanced > Select the account to remove > Click remove.

In my case i was doing new Mac book setup.

Without installing Xcode i was trying to clone branch using SourceTree.

After Xcode installation done, branch cloned successfully.

SourceTree asked for system password for cloning.

Related