• notice
  • Congratulations on the launch of the Sought Tech site

Connect Github service in macOS

I remember I wrote an article about using Git under win before, and today I wrote an article under mac.

First, you need to install git under mac

The address of mac git: http://code.google.com/p/git-osx-installer/ Since this URL may not be accessible, you need to use the source code to install.

After installing Git, it's time to set up the GitHub connection

1, Check if ssh keys exist

$ cd ~/.ssh

If you don't have a .ssh directory, skip to step 3.

2, If there is a .ssh directory, please back up your ssh key

$ ls
$ mkdir key_backup //Create backup folder
$ cp id_rsa* key_backup //move your key file to backup folder
$ mr id_rsa*

3, create a new ssh key

$ ssh-keygen -t rsa -C "[email protected]" //Remember to enter the email address of your github account
// will output the following statement
Generating public/private rsa key pair.
Enter file in which to save the keys
(/Users/your_user_directory/.ssh/id_rsa): <press enter> //You need to press the enter key here

After pressing enter, the following prompt will appear:

Enter passphrase(empty for no passphrase): <enter a passphrase> //Enter a password
Enter same passphrase again: <enter passphrase again>

Afterwards, you'll get a bunch of prompts, roughly telling you that the id_rsa and id_rsa.pub files have been created.

4, Add your ssh key on GitHub

Go to the .ssh directory just now, find the id_rsa.pub file, copy the contents, and enter it into the Add key area of your GitHub account. There will be a corresponding prompt when the creation is successful.

5, Verify your GitHub connection

$ ssh -T [email protected]

If the verification is successful, the following prompt will appear:

Hi username! You have successfully authenticated, but GitHub does not provide shell access.


Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

order generic lipitor 20mg & lt;a href="https://lipiws.top/"& gt;order atorvastatin 20mg& lt;/a& gt; order atorvastatin 40mg generic

Mtxekb

2024-03-07

Leave a Reply

+