39

I know that similar questions have already been posted here. However, I think 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 a GitHub account with permissions to clone and push the repository. In order to manage a local copy, I need to clone the online 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 to my GitHub account so the link is correct.

  3. The nest step is to specify a local folder where the repository will be copied. However, 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 following 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. SourceTree does not tell me the reason for the error or anything else.

I tried to re-install 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 a 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. However, 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?

Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
Pavel Pavlov
  • 697
  • 2
  • 9
  • 18

29 Answers29

47

Lastly on Mac I went to

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

and it works... puf!

MrHIDEn
  • 1,723
  • 1
  • 25
  • 23
43

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.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Vikash Sinha
  • 869
  • 1
  • 7
  • 21
21

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)
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 3
    Thank you for the references. At the end it turned out that all the proxy settings and the credentials are correct, but the embedded package for Git was disabled. Shame on me that I did not check for this possibility. In order to make SourceTree work I went to Tools -> Options -> Git tab and I enabled the package. After that I successfully clones the repository. Thank your for your answer. – Pavel Pavlov Dec 24 '13 at 06:21
  • @PavelPavlov - Turns out I had the same issue as well. – Eric Kigathi Aug 07 '14 at 19:03
7

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!

h3xStream
  • 6,293
  • 2
  • 47
  • 57
Pavel Kovalev
  • 7,521
  • 5
  • 45
  • 67
5

I was facing the same issue with windows 10 and source tree. After bit research following solution worked for me. I needed to download or enable the git support in source tree.

Steps 1) Go to Tools -> Options -> Git -> Enable git support

That's it it resolved my issue. Happy coding :)

SANDIP
  • 89
  • 1
  • 4
5

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
1

May I also just add that I resolved this issue by installing Git through SourceTree from [SourceTree]>Tools>Options>Git.

As I'd been using mercurial exclusively on that system till then it had never been installed, and so was presenting the above described error when trying to clone.

Hopefully this helps someone with the same issue! If not, good luck!

Fehr
  • 476
  • 4
  • 5
1

I was facing the same issue with windows 10 and source tree. After bit research following solution worked for me. I needed to download or enable the git support in source tree.

Steps 1) Go to Tools -> Options -> Git -> Enable git support

That's it it resolved my issue. Happy coding :)

SANDIP
  • 89
  • 1
  • 4
1

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.

1

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

Atif Mukhtiar
  • 1,186
  • 9
  • 11
1

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.

Eran Goldin
  • 980
  • 12
  • 21
1

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.

Peter Meadley
  • 509
  • 2
  • 16
1

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.

1

In my case I had used SourceTree's "Add account" setting to add my Bitbucket and GitHub accounts to SourceTree under the SSH protocol. SourceTree did everything correctly to generate SSH keys and add them to my machine but it made a slight mess of the entries that it added to my ~/.ssh/config file. It created entries as follows:

Host username-Bitbucket
  HostName bitbucket.org
  User username
  PreferredAuthentications publickey
  IdentityFile /Users/adil/.ssh/username-Bitbucket
  UseKeychain yes
  AddKeysToAgent yes

Host username-GitHub
  HostName github.com
  User username
  PreferredAuthentications publickey
  IdentityFile /Users/adil/.ssh/username-GitHub
  UseKeychain yes
  AddKeysToAgent yes

The Host values it generated are incorrect. I changed the entries in my ~/.ssh/config file to the following:

Host bitbucket.org
  User username
  PreferredAuthentications publickey
  IdentityFile /Users/adil/.ssh/username-Bitbucket
  UseKeychain yes
  AddKeysToAgent yes

Host github.com
  User username
  PreferredAuthentications publickey
  IdentityFile /Users/adil/.ssh/username-GitHub
  UseKeychain yes
  AddKeysToAgent yes

After making this change, the "This is not a valid source path / URL" error went away and I was able to clone repositories from my Bitbucket and GitHub accounts without problem.

Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
1

I removed and added my account again using the HTTPS rather than SSH URL.

domdomegg
  • 1,498
  • 11
  • 20
0

I had to uninstall and reinstall SourceTree before it would work. I think my antivirus (Comodo ) was blocking/sandboxing some stuff on the initial install so I disabled it for the reinstall.

0

I had also same issue This is not a valid source path / URL and it got resolved by updating the Embedded Git of Source Tree.

This issue also manifested itself where I couldn't push or pull from previously cloned and working repositories in source tree. I complained about authentication username and password but clearly that was not the case.

Steps to resolve: Open source tree, Tools -> Options -> Click on Git Tab -> Update Embedded Git.

CDspace
  • 2,639
  • 18
  • 30
  • 36
gp7
  • 1
  • 1
0

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.

0

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

vinay shetty
  • 895
  • 1
  • 9
  • 15
0

The issue might be because of SourceTree didn't have all private access from Github

I have answered here please check to avoid the duplicate answer posting reference link

https://stackoverflow.com/a/62145210/4328589

Suresh Maidaragi
  • 2,173
  • 18
  • 25
0

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.

Abhay Singh
  • 171
  • 1
  • 7
0

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
0

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.

0

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.

Arshad Shaik
  • 1,095
  • 12
  • 18
0

I'm posting another possible solution, as I just helped a colleague who couldn't clone a private repo belonging to a GitHub organization even though he had been given the correct level of access.

Check the Windows Credential Manager, especially if you've been using the same machine for some time or have connected to different accounts.

Git may be picking up the wrong credentials without you realizing it, and that's why it can't find the repo.

To be on the safe side, delete all the credentials that have to do with git/github. You'll know you have done it properly and are starting from a fresh state when you will try cloning again and git will ask you to authorize it through your browser.

s.m.
  • 7,895
  • 2
  • 38
  • 46
0

probably you try the wrong account only add this account.name@ to link

you can learn it from your GitLab account

https://account.name@gitlab.com/samrak-growth/samrak-app-backend.git

Samet ÖZTOPRAK
  • 3,112
  • 3
  • 32
  • 33
0

In my specific case (setting up a new mac) the root cause was a "missing xcrun" meaning the local dev tools wasn't activated, and the local git client can't run properly.

that was my fix

xcode-select --install
0

In my case the URL generated from SourceTree was wrong. Somehow my organisation's name was appended at the start of URL. I copied the repo link directly from github. It resolved my issue.

iAnurag
  • 9,286
  • 3
  • 31
  • 48
0

I have had same issue and to make it worst when I deleted Account from the SourceTree (SourceTree -> Preferences -> Advanced -> Remove), my SourceTree was not prompting me to Authenticate anymore. It did not allow me to login in - instead just displayed an error 'This is not a valid source path / URL'.

I resolved it by clearing my .gitconfig file. Open Terminal and navigate to root directory, open .gitconfig, delete content and save it.

Then copy repo URL (Try copy it from the actual URL scope) and paste in SourceTree. At this point Sourcetree should present an Authentication pop up window to allow you type your credentials again.

Once you Authenticate successfully, new content of the .gitconfig will be automatically generated.

marika.daboja
  • 881
  • 13
  • 27