Cloning a repository with SourceTree

北慕城南 提交于 2019-12-20 11:05:44

问题


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?


回答1:


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.




回答2:


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)




回答3:


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.




回答4:


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.




回答5:


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




回答6:


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.




回答7:


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.




回答8:


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




回答9:


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




回答10:


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.




回答11:


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




回答12:


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.




回答13:


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.




回答14:


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.




回答15:


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.




回答16:


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.



回答17:


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.




回答18:


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



回答19:


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.




回答20:


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.




回答21:


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.




回答22:


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



来源:https://stackoverflow.com/questions/14072361/cloning-a-repository-with-sourcetree

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