惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
Y
Y Combinator Blog
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
MyScale Blog
MyScale Blog
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
量子位
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
C
Cybersecurity and Infrastructure Security Agency CISA
L
Lohrmann on Cybersecurity
L
LINUX DO - 最新话题
The Register - Security
The Register - Security
T
Tailwind CSS Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
T
Troy Hunt's Blog
Stack Overflow Blog
Stack Overflow Blog
Cloudbric
Cloudbric
S
Secure Thoughts
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
L
LangChain Blog
Recorded Future
Recorded Future
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Tor Project blog
人人都是产品经理
人人都是产品经理
F
Full Disclosure
O
OpenAI News
Webroot Blog
Webroot Blog
A
Arctic Wolf
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
H
Heimdal Security Blog
B
Blog RSS Feed
Vercel News
Vercel News

博客园 - Ant

ASP.NET Core 项目简单实现身份验证及鉴权 使用iconfont图标 IIS调试ASP.NET Core项目 Visual Studio连接Oracle数据库 Visual Studio Code 如何将新项目发布到GIT服务器 Xamarin踩坑经历 Abp项目中的领域模型实体类访问仓储的方法 在Abp中集成Swagger UI功能 发布以NLog作为日记工具的ASP.NET站点到IIS注意事项 Android Studio 简介及导入 jar 包和第三方开源库方[转] 解决jquery-ui-autocomplete选择列表被Bootstrap模态窗遮挡的问题 ORACLE存储过程创建失败,如何查看其原因 EF6配合MySQL或MSSQL(CodeFirst模式)配置指引 火狐通行证升级为Firefox Sync后,如何在多设备间同步书签等信息 (原创)通用查询实现方案(可用于DDD)[附源码] -- 设计思路 (原创)通用查询实现方案(可用于DDD)[附源码] -- 简介 利用Lambda获取属性名称 Entity Framework 6.0 源码解读笔记(一) [转]Sql server2005中如何格式化时间日期
配置GitHub的SSH key
Ant · 2018-11-29 · via 博客园 - Ant

配置GitHub的SSH key

生成密钥对

打开git bash工具(Windows环境),Linux则直接打开命令行,执行下面的命令生成密钥文件

ssh-Keygen -t rsa -C "注册Github账号所用邮箱"

中间询问时一律直接按回车,生成后的文件位于用户Home目录下的.ssh目录中

将id_rsa.pub公钥文件的内容复制到剪贴板备用

添加公钥到GitHub

登录Github网站,点击用户头像,在弹出的菜单中选择"Settings",进入用户设置界面

在左边的导航菜单中选择"SSH and GPG keys",然后点击[New SSH key]按钮

Title随便输入,将之前已经复制到剪贴板的公钥内容粘贴到Key文本框中,然后点击[Add SSH key]按钮。

此时列表中该项目前面的钥匙图标是黑色的

SSH确认连接

在之前打开的命令行中输入下面的指令

ssh -T git@github.com

如果遇到"The authenticity of host 'github.com (192.30.253.112)' can't be established."类似的提示并询问则输入"yes",之后再次执行上面的指令

看见You’ve successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github。

上传本地仓库到GitHub

在终端命令行切换到项目所在目录,执行git init指令,初始化本地git仓库

如果不想使用git全局设置中默认的用户信息,第一时间先使用git config指令设置当前仓库使用的git用户名及邮箱,因为之后的所有提交操作所记录的用户信息都从这里来

执行git add * 将本地文件添加到仓库,再执行 git commit -m "初次提交"指令提交修改

执行git remote add origin git@github.com:[用户名]/[仓库名].git关联到远程仓库

如果之前已经关联到使用https协议的仓库地址,可通过git remote set-url origin git@github.com:[用户名]/[仓库名].git指令来重新设置远程仓库地址

做好这一切准备工作后,执行下面一行指令即可上传代码到GitHub

git push origin master

刷新之前的GitHub网页,应该可以见到密钥项前面的钥匙图标已变为绿色。

参考资料

配置github的SSH key及GitHub项目上传
初次使用git配置以及git如何使用ssh密钥
git使用中遇到的remote:Permission to xxx denied to xxx问题如何解决
Git 最著名报错 “ERROR: Permission to XXX.git denied to user”终极解决方案