31

Can someone give me a quick walkthrough on simply cloning a repo with SourceTree?

In Bookmarks, I click on Clone Repository. For Source Path I paste in the URL which looks like this:

git@codebasehq.com:client/appname/ios-application.git

But I get "This is not a valid source path / URL".

I'm copying directly from the Repository Browser in codebase so I know the URL is correct.

What else do I need to do?

nwellnhof
  • 32,319
  • 7
  • 89
  • 113
soleil
  • 12,133
  • 33
  • 112
  • 183

22 Answers22

22

My solution was to change the Git version from 'Use Embedded Git' to 'Use System Git'. Because I installed GitHub on my computer earlier, it seems SourceTree chose that Git by default rather than download the embedded version when it was installed.

nobody
  • 19,814
  • 17
  • 56
  • 77
Y Zhang
  • 223
  • 2
  • 6
  • 1
    This wasn't the exact solution to my problem - but it pointed me in the right direction. For me, when I went to the "Git" tab, it showed that it was disabled. I enabled it, and it all worked fine after that. – Origin Jul 28 '14 at 04:09
  • This fixed my issues and made it so local repos would clone correctly from remotes within our network. – Ian Lewis Mar 30 '15 at 10:09
  • 1
    Origin's comment helped... I had to enable git in source tree..Saved my day!!!!!!!!!!!! – Sunny Shah Nov 16 '15 at 12:01
5

I helped a friend resolve this simply by filling in name and email address for 'Default user information', found in the General tab under Tools/Options(Windows) or SourceTree/Preferences(iOS)

Alex Patton
  • 51
  • 1
  • 2
  • 1
    That simple tip solved my problem, thanks. After that, make sure to close and re-open SourceTree. – MaDDoX Jul 19 '15 at 21:12
4

The solution for me was to confirm my email address. So if you haven't already, check your emails and find the one from your source repository provider (e.g. bitbucket). You should have a confirm email section in the email.

nobody
  • 19,814
  • 17
  • 56
  • 77
whiteElephant
  • 263
  • 1
  • 6
  • 21
2

As illustrated in this Atlassian thread, this is usually related to a credential issue.

In your case, it could be an ssh configuration problem, with no or the wrong ssh public/private keys.
Or, still for ssh, it can be related to ssh keys incorrectly registered.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • It must be that in my case: I cannot enter my login details anywhere! (there is no field for them in the dialog to clone a repo, how swell!). – user14764 Jan 25 '16 at 21:06
  • Actually I wanted to log in by username/password. This is the easiest way with OpenSSH included in Windows Server 2022. Can't Sourcetree (or Git) do that? – The incredible Jan Aug 15 '23 at 12:13
  • @TheincredibleJan Username/password is usually reserved for HTTPS credentials. And you would need, as mentioned in [this thread](https://community.atlassian.com/t5/Sourcetree-questions/How-do-I-use-a-personal-access-token-PAT/qaq-p/1263836), a PAT (Personal Access Token) for Sourcetree. The token is used in place of your password. – VonC Aug 15 '23 at 13:15
  • @VonC I don't really care about "usually" :) I just want to use my own git server as easy as possible. Sourcetree looked nice (I'm used to TortoiseHg Workbench), but I could live without it if Git itself could handle normal username-password SSH... – The incredible Jan Aug 15 '23 at 13:42
  • @TheincredibleJan "normal username-password SSH" is not normal: SSH is used with an SSH key as [mentioned here](https://serverfault.com/a/241593). [gitolite](https://gitolite.com/gitolite/overview.html) uses that extensively. I am sure Sourcetree or, the one I use, [Gitea](https://github.com/go-gitea/gitea), support it too. That being said, you can [configure password-based SSH authentication](https://docs.bitnami.com/virtual-machine/faq/get-started/enable-ssh-password/) – VonC Aug 15 '23 at 13:53
1

In my case I had to dis-check this: Options > Network > add proxy server conf to Git/Mercurial

Mladen Rakonjac
  • 9,562
  • 7
  • 42
  • 55
1

I am on a Mac. No solution from these answers worked for me, but I figured out in the end by going in Accounts an switching Bitbucket from SSH to HTTPS. I was able to clone the repo.

Symyon
  • 388
  • 2
  • 10
0

In my case the way I finally solved it was to uninstall SourceTree, delete the X:/Users/UserName/AddData/Local/Atlassian folder, and the reinstall the latest SourceTree. Then I went through the SourceTree setup, cloned the remote repo as normal, and I was back in business.

As a reminder, if you go this route and you have local changes that haven't been pushed yet (like I did) make sure you copy those out to another folder BEFORE you start this process, just to be on the safe side.

nobody
  • 19,814
  • 17
  • 56
  • 77
William Smith
  • 1,949
  • 4
  • 25
  • 45
0

I had that problem after installing new SourceTree version.

In my case it helped to uninstall Git from my Programs. When I started SourceTree again it asked to install Git, so I did and the problem was fixed.

Kinda brutal solution, but didn't want to spend more time trying to figure out the problem.

moonlightcat
  • 29
  • 1
  • 6
0

i have dowloaded the sourcetree an the GIT an use the local GIT installed not what sourcetree offers. that resolves the error.

  • Welcome to Stack Overflow! Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Enamul Hassan Mar 08 '16 at 16:15
0

It happened to me when I first run SourceTree after installing. Restarting SourceTree and this particular error went away.

Anton Duzenko
  • 2,366
  • 1
  • 21
  • 26
0

For me the issue was it wouldn't accept my password. The fix was in Preferences > Network > edit the default entry to set my github username rather than my Mac username.

bedouger
  • 545
  • 2
  • 5
  • 15
0

For me, the solution was to enable Git Support from Source Tree. Tools --> options --> Git (Enable Git Support)

0

It seems SourceTree can be pretty annoying in this respect. In my case, the problem was I had introduced a wrong password the first time I used SourceTree. I solved this (on a Mac) by going to SourceTree > Preferences > Accounts, clicked on my account, set the correct password and voilà. Done.

e18r
  • 7,578
  • 4
  • 45
  • 40
0

In my case, i did not had installed GIT on Sourcetree. It automatically asking when initial installation but i missed it somehow. so i installed GIT manually, Goto Tools > Options > GIT > follow the steps to add the GIT to your SourceTre.

Shanka
  • 23
  • 4
0

If you've maybe accidentally entered an incorrect password for this repository's domain before, you may be getting this error because of that. I had to go on the preferences panel, under the Network tab and delete the row that contained that URL's domain, and it prompted me again for it next time I tried to download the repo. Annoying that it doesn't ask you for the password ever again.

Lucas C. Feijo
  • 1,002
  • 3
  • 13
  • 29
0

If you use 2-step authentication, give a token and not the regular password (that solved it for me on MAC with SourceTree 2.4), It can be done in SourceTree > Preferences > Accounts.

Lior Bar
  • 1
  • 1
0

as for me following two steps helped.

  1. Enable alternate credentials on vsts
  2. First clone (SourceTree already installed) via command line.
  3. Source tree -> new repository -> add existing local repository.
programstait
  • 195
  • 1
  • 11
0

I believe it has to do with the integration of BitBucket and Atlassian accounts.

It works when I change the Source URL from:

git@bitbucket.org/...

To

myusername@bitbucket.org/...
Greg T
  • 3,278
  • 3
  • 37
  • 39
0

These things helped me

  • Replace SSH with Https links for the URL format.
  • Delete any old access keys (that of SourceTree) in your key chain access. This needs to be done when you change your Git repo password.

Now try to clone again. This should fix your problem.

iPhoneDeveloper
  • 958
  • 1
  • 14
  • 23
0

It is known that there are issues with the clone function from Sourcetree on Mac. However there is a workaround which works for me:

Steps:

  • Remove Sourcetree completely from your local disk (incl the 2 data folders)
  • Remove the GIT hub folders from your machine.
  • Change in the Keystore your login password to something else.
  • Reboot your system twice (2x)
  • Now you can install Sourcetree again, but do not clone from your repository!!!
  • Open a terminal and create your new (!) repository folder
  • In the terminal move to this folder and clone the repository. Command: git clone <---repository-> . (Note the dot at the end!)
  • Open finder
  • Go to the parent of the repository folder
  • Drag/drop the folder of your computer-repository into Sourcetree
  • Reboot your computer again

This last step was needed for me to be able to perform PUSH.

Vincent
  • 4,342
  • 1
  • 38
  • 37
0

Please check the error details. If the problem is "Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.", it means you entered wrong password probably. If you use Mac, delete the saved password from KeyChain Access and then try again.

Michael42
  • 881
  • 1
  • 8
  • 15
0

Kindly follow these simple steps

  1. Create a repo on https://bitbucket.org
  2. Install Source Tree and click on "+" button (Look at my attached image with this answer)
  3. Click on "Remote: button on the top (very very important)
  4. Past your URL that is copied by https://bitbucket.org (where you repo is)
  5. Wait until the text appears "This is a valid Git repo etc"
  6. Set your destination path
  7. Click on Clone button

Image

Pavel Smirnov
  • 4,611
  • 3
  • 18
  • 28
Samra Khan
  • 74
  • 1
  • 10