Generating SSH keys. If you don’t have a SSH public/private key pair you can generate it using the puttygen utility. From now on I’ll use%USERHOME% whenever I refer to your Windows user home folder, which depending on your Windows version may be located in. 4.3 Git on the Server - Generating Your SSH Public Key. Generating Your SSH Public Key. That being said, many Git servers authenticate using SSH public keys. In order to provide a public key, each user in your system must generate one if they don’t already have one. GitHub Enterprise Server Authentication Connecting to GitHub with SSH Generating a new SSH key and adding it to the ssh-agent Generating a new SSH key and adding it to the ssh-agent After you've checked for existing SSH keys, you can generate a new SSH key to use for authentication, then add it to the ssh-agent.
Let MAC connect with its GitHub website locally (SSH)
Download and install git website: https://git-scm.com/downloads
Check whether the installation is successful: git – version
$ git version
git version 2.15.1 (Apple Git-101)
chengyuandeMBP:.ssh chengyuan$
Create SSH key: check whether there is SSH
$ cd ~/.ssh
$ ls
![Generate Generate](/uploads/1/2/6/6/126623391/488406625.png)
id_rsa id_rsa.pub known_hosts
![Ssh key github Ssh key github](/uploads/1/2/6/6/126623391/855043433.png)
It is recommended to recreate SSH whether there is one or not
Create SSH
$ ssh-keygen -t rsa -C [email protected] // 1. Email account of [email protected] when you sign up for GitHub
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/dpc/.ssh/id_rsa): // 2. . SSH default path, do not enter or modify
Enter passphrase (empty for no passphrase): // 3. The password length must be at least 4, otherwise it will fail
Enter same passphrase again:
Your identification has been saved in /Users/dpc/.ssh/id_rsa.
Your public key has been saved in /Users/dpc/.ssh/id_rsa.pub.
The key fingerprint is:
8d:d3:5f:31:ae:13:48:f0:78:df:a1:8f:a5:a4:c0:06 [email protected]
The key’s randomart image is:
+–[ RSA 2048]—-+
| . |
| + |
| E . + + |
| o * o + + |
| S + = = |
| . o + O |
| . * . |
| . |
| |
+—————–+
Enter file in which to save the key (/Users/dpc/.ssh/id_rsa): // 2. . SSH default path, do not enter or modify
Enter passphrase (empty for no passphrase): // 3. The password length must be at least 4, otherwise it will fail
Enter same passphrase again:
Your identification has been saved in /Users/dpc/.ssh/id_rsa.
Your public key has been saved in /Users/dpc/.ssh/id_rsa.pub.
The key fingerprint is:
8d:d3:5f:31:ae:13:48:f0:78:df:a1:8f:a5:a4:c0:06 [email protected]
The key’s randomart image is:
+–[ RSA 2048]—-+
| . |
| + |
| E . + + |
| o * o + + |
| S + = = |
| . o + O |
| . * . |
| . |
| |
+—————–+
Open GitHub and click your avatar settings A kind of : SSH and GPG keys on the left navigation bar A kind of ️ new SSH key
Go back to the command line $open ~ /. SSH
Open the id_rsa.pub file in the pop-up folder and copy the contents (you can also find it by yourself according to the path)
Paste the copied content into the key of new SSH key, add and save it, and fill in the email of my own GitHub when registering
Check whether the key configuration is effective SSH – t [email protected]
$ ssh -T [email protected]
Enter passphrase for key ‘/Users/dpc/.ssh/id_rsa’://Password just set****
Hi dopocheng! You’ve successfully authenticated, but GitHub does not provide shell access!!
Submission code
1. Initial submission agent
Enter the folder where you want to submit the code (important!!)
$git init / / initialize local warehouse
$git add XX. JSON / / add the code file to be submitted
$git commit – M “your comment…” / / submit to local repository
$git remote add origin [email protected]: XXXX / xxxx.git / / connect to the remote warehouse (i.e. GitHub)
$git push – U origin master / / first commit
$git add XX. JSON / / add the code file to be submitted
$git commit – M “your comment…” / / submit to local repository
$git remote add origin [email protected]: XXXX / xxxx.git / / connect to the remote warehouse (i.e. GitHub)
$git push – U origin master / / first commit
Git Windows Generate Ssh Key
Note that git @ GitHub. Com: XXXX / XXXX. Git = = git @ GitHub. Com: dopocheng (a picture of a dot whose GitHub user name is not known) / alone part (the project name should be the same as the suggested project name). Git
2. Modify code or change local computer to submit
Git status view modified files
Changes not staged for commit:
(use “git add/rm …” to update what will be committed)
(use “git checkout — …” to discard changes in working directory)
deleted: “src/views/complex-component/346226260345273272346226207346234254346226207346241243 (2).txt”
modified: src/views/echarts/covid-19.vue
no changes added to commit (use “git add” and/or “git commit -a”)
Git add with modification and subject submission and git commit
$git add Src / views / echorts / covid-19.vue / / add the code file to be submitted
$git commit – M “new coronavirus statistics modification” / / submit to local warehouse
$ git push origin master
$git commit – M “new coronavirus statistics modification” / / submit to local warehouse
$ git push origin master
If git push fails
View the above key configuration SSH – t [email protected]
Not OK. Go to reconfigure the key
OK! Then check the remote warehouse details
$ git remote -v
origin[email protected]:dopocheng/alone-part.git (fetch)
origin[email protected]:dopocheng/alone-part.git (push)
Dopocheng must be your own GitHub user name. Alone part is the remote warehouse name corresponding to the first project you submit
GitHub view warehouse name
If not, add or modify the remote warehouse
$ git remote add origin [email protected]:dopocheng/alone-part.git
Git Ssh Key Generate Github Free
fatal: remote origin already exists.
Delete git remove origin first
Add git remote add origin [email protected]: dopocheng / alone-part.git (I use SSH and you can switch use HTTPS)
Git Ssh Key Generate Github Free
In this way, you can check the remote warehouse information again, and git push will be OK!!!