How to configure Oschina SSH public key and configuration under Mac Sourcetree

Source: Internet
Author: User
Tags sourcetree

With the free git space provided by Oschina, you can avoid the hassle of configuring your Git server, and also solve problems that SVN cannot submit locally.

1. Generate Sshkey under terminal, sometimes input 1th times no response, need to run 2 times

Ssh-keygen-t rsa-c "Your Mailbox"

The prompt appears:

Generating public/private RSA key pair.

Enter file in which to save the key (/users/your Mac user name/.ssh/id_rsa):

2. Direct Enter, save the key pair to the default location/users/ your Mac user name /.ssh/id_rsa

The prompt appears:

Created directory '/users/your Mac user name/.ssh '.

Enter passphrase (empty for no passphrase):

3. Enter password key pair password, general not set, direct enter, again enter

A prompt similar to this appears:

Your identification has been saved in/users/your Mac user name/.ssh/id_rsa.

Your public key has been saved in/users/your Mac user name/.ssh/id_rsa.pub.

The key fingerprint is:

Sha256:+4xdhivkajdjbf0zbakqmxl+mp372xa86phvyvqfqvpy "Your e-mail

Ssh-keygen-t rsa-c "Your e-mail

The key ' s Randomart image is:

+---[RSA 2048]----+

| ..         =+=+. |

|.        +.+fo. |

| O.o.* O |

|+oo++ =. |

|O.==.O OS. |

| *+o.       .. |

| Ooo..        .. |

|.  =   .. +       |

|*o=. .. o |

+----[SHA256]-----+

4. View the public key

Cat ~/.ssh/id_rsa.pub

The prompt appears:

Ssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqcoibhh9t2vzdfgtjn+gkk4pjpcsuu/qt+ g7l2utyvkyhpxwx17wsnmy5gehircm64mgaekle44k0sqhyvckvhrpa2/bdhgt7rkskp1al+rk3nam2x73argqvr+kklwtbbk/x7pjdhrq+ Jr0lixlzsf38nt4e1xikgl+/ubu8fguijejacm9rw9exjhuw2lchsq9mmqjrdhxd+ e9ikonmijyug1kst60ktfd5g60kaojhrq6zidnmkihmvamy9ebl4jvbszmjhddte3prgakgun5+ I41kwdg0ax2dcmajjmpldjqmmgmlegi6xd6qi+b6anpakwqotog29xm2t0xpzp "Your e-mail

Don't copy the following sentence

Ssh-keygen-t rsa-c "Your e-mail

5. Copy the public key and add it to the Code cloud (https://git.oschina.net)

6. Connect to the Code cloud

SSH-T [email protected]

The prompt appears:

The authenticity of host ' git.oschina.net (103.21.119.119) ' can ' t be established.

ECDSA key fingerprint is SHA256:FMNC9KN/EYE1W8I89BGRQP+KKGYHJGBVR17BMJEY0WC.

Is you sure want to continue connecting (yes/no)?

7. Enter Yes

The prompt appears:

warning:permanently added ' git.oschina.net,103.21.119.119 ' (ECDSA) to the list of known hosts.

Welcome to [email protected], xxx!

This shows that the SSH public key has been completed and the GIT admin project will not have to enter a password

8. Create a private or public project on Git.oschina.net

9. Select SSH, copy the project address, and prepare to manage the project with Sourcetree

[Email Protected]:xxx/xxx.git

10. Create a local git project to store the directory ABC

11. Switch the working directory to ABC

CD XXX/ABC

12. Cloning a project to a working directory

git clone [email protected]:xxx/xxx.git

The prompt appears:

Cloning into ' Weibo ' ...

Remote:counting Objects:3, done.

Remote:compressing objects:100% (2/2), done.

Remote:total 3 (Delta 0), reused 0 (Delta 0)

Receiving objects:100% (3/3), done.

Checking connectivity ... done.

This indicates that the clone is complete and the project catalog EFG will appear in the ABC directory

13.GitHub Download Ignore file Https://github.com/github/gitignore, find the specified type of ignore file placed in the project directory, the previous file name is removed, Remove and then hide the file (if you select Ignore file on Oschina conflict, you can also use the Ignore file on Oschina)

14. Drag the cloned project folder (not the local working directory ABC, but the project directory EFG, otherwise do not see the need to submit files) to Sourcetree, submit ignore file to the server

15. Create project to EFG directory, Commit->push project to Oschina

How to configure Oschina SSH public key and configuration under Mac Sourcetree

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.