Issue with SourceTree while cloning a GitHub repository

亡梦爱人 提交于 2019-12-09 14:30:58

问题


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 saying: "This is not a valid path/URL" and a Details button next to the error.

But the problem is that the Details are 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?


回答1:


The exact error message is (as illustrated here):

 This is not a valid source path / URL

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)



回答2:


I was facing the same issue in source tree in Mac system i.e; "This is not a valid path/url". The following solution worked for me.

  1. Go to preference in Sourcetree.
  2. Go to Advanced settings
  3. Remove the host name
  4. Again clone the project in sourcetree
  5. A prompt will come, enter the git credentials.

That's it, It resolved my issue.




回答3:


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.




回答4:


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 :)




回答5:


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!




回答6:


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




回答7:


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.




回答8:


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 :)




回答9:


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.




回答10:


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.




回答11:


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.




回答12:


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.



来源:https://stackoverflow.com/questions/20718193/issue-with-sourcetree-while-cloning-a-github-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!