当前位置:网站首页>Use SSH to pull codes
Use SSH to pull codes
2022-06-29 17:17:00 【Hua Weiyun】
Use
SSHWay to pull code
We are using git When pulling code , Have you ever encountered something like OpenSSL SSL_read: Connection was reset, errno 10054 Error message , Solution reference
The probable cause lies in The Internet On the body , To avoid various modification agents , This machine host And other cumbersome operations , I recommend you to use SSH Way to pull code . So first you need to finish SSH Basic configuration , The following is the detailed configuration process
adopt SSH Way to pull code
If you don't already know git Some of the basics of , please Reference here
1. Configure the username and mailbox
$ git config --global user.name " user name "$ git config --global user.email " User mailbox "2. Generate key pair
First, check whether a secret key pair has been generated on the device
$ cd ~/.ssh // Enter the specified path folder $ ls // View the contents under the folder See if there is id\_rsa and id_rsa.pub Wait for the documents ,.pub The file is a public key , The other file is the key
Without these documents , Or not .ssh Catalog , Then use ssh-keygen Command to create
$ ssh-keygen -t rsa -C " Your email " If prompted , Click on enter that will do ,== No need to set password !== Do you want to enter your password before each code submission ?
After success will prompt
Your public key has been saved in /home/you/.ssh/id_rsa.pub.The key fingerprint is: 3. Get into .ssh Folder , Find public key
Enter the designated path .ssh In the folder , Open in Notepad id_rsa.pub, Select all copy content
It can also be viewed through instructions
$ cat ~/.ssh/id_rsa.pubfor example :
ssh-rsa your secret [email protected]4. Enter the code hosting platform , Upload key
Let's say GitHub For example , Demonstrate relevant operation process
1. land github account , Click on your avatar , then Settings -> SSH and GPG keys -> New SSH key
2、 Then you copy the public key content above , Paste in key In the text field . title Domain , Name yourself
3、 Click on add key
After completion , Verify this key Is it normal work :
$ ssh -T [email protected] to ssh to githubIf , See the following message
Hi xxx! You've successfully authenticated, but GitHub does not # provide shell access.Congratulations , Configuration is successful !
5. Find the project warehouse SSH Address
Use command git remote \-v Check out your current remote url
$ git remote -vorigin https://github.com/username/project.git (fetch)origin https://github.com/username/project.git (push) If it is the result of the above, then it indicates that the project is using https Protocol to access ; If the address is git At the beginning, it means git agreement
Landing on your github Account , View the project Repository ssh Agreed URL

Copy ssh link , Use command git remote set-url modify remote-url, for example :
git remote set-url origin [email protected]:username/project.gitLast command
git remote -v testing URL Has it been modified to SSH Address
6. Use this address to submit... In the future / Just pull the code

边栏推荐
猜你喜欢
随机推荐
The fixed assets management system enables enterprises to dynamically master assets
[R language data science]: Text Mining (taking Trump's tweet data as an example)
固态存储厂商忆联加入龙蜥社区,共建开源新生态
New feature of C11 - Auto and decltype type type indicators
微信小程序开发储备知识
Kubernetes deployment dashboard (Web UI management interface)
Redis bloom filter and cuckoo filter
Summary of problems during xampp Apache installation
535. TinyURL 的加密与解密 / 剑指 Offer II 103. 最少的硬币数目
KUKA robot external axis configuration what you must know
c# 国内外ORM 框架 dapper efcore sqlsugar freesql hisql sqlserver数据常规插入测试性能对比
2022年软件评测师考试大纲
An error is reported in the Flink SQL rownumber. Who has met him? How to solve it?
开源仓库贡献 —— 提交 PR
What are the project management systems suitable for small and medium-sized enterprises?
6.25atcoderabc257e - addition and multiplication 2
Practice | solution for image upload, rotation and compression on mobile terminal
Bags of Binary Words for Fast Place Recognition in Image Sequenc
mysql游标的作用是什么
Understanding adapter mode from home office | community essay solicitation









