the difference between HTTPS and ssh cloning methodsHTTPS: The account and password need to be validated each time the fetch and push push code is fetched. (for users who are just learning to read project code)
SSH: If you are a project member, you can use this method to obtain and push the operation without having to authenticate the account again. You need to create the SSH key locally and add it to the code cloud beforehand. (suitable for project members, participate in project development)
Because the HTTPS is simpler, so here is not to talk about it. The main way to talk about the cloning of SSH. Second, create add Ssh-key open Sourcetree, Operation--Open in terminal (install Git in advance)--enter command line here
1, create: ssh-keygen-t rsa-c wdehxiang@163.com
Three times enter this does not need to set the password, saves trouble. Which wdehxiang@163.com this is my registered mailbox, you change into your own.
2. View: Cat ~/.ssh/id_rsa.pub
View public key value, right-click copy. You can also enter C:\USERS\ADMINISTRATOR\.SSH to open id_rsa.pub copy public key with Notepad
3, add: Login Code Cloud--Personal center--Modify data--ssh public key
4, test: Ssh-t git@git.oschina.net
If you can see welcome, your nickname, the description is successful.
5, Configuration: Open the sourcetree--tool--options--In the SSH client select openssh--Complete
third, start cloning SSH1, login code cloud, into open source projects, choose their own wish to import Sourcetree a project.
2, click on the clone after entering the project, you will see HTTPS and ssh two ways, first of all, we choose SSH mode, copy URL
3, open Sourcetree, click Clone
4, clone success, now can start operation.