0


ssh公钥配置,使用git从github上拉取、上传项目

一、ssh公钥配置

若在以下某个步骤出现问题:

Please make sure you have the correct access rights and the repository exists

则按本节方法重新配置ssh。

  1. 删除C:\Users\Administrator.ssh下的所有文件

  1. 在桌面右击,选择Git Bash Here

# 1.设置用户名
git config --global user.name ‘aaa’

# 2.设置用户名邮箱
git config --global user.email ‘[email protected]’

# 3.查看设置
git config --list

# 执行命令,接下来一路回车
ssh-keygen -t rsa -C "[email protected]"
  1. 配置github

进入Setting,新建SSH keys,将

将id_rsa.pub里的内容copy到下面的框里,点击完成

二、github项目拉取

  1. 在本地新建一个文件夹,命名随便,在此处右击,选择Git Bash Here

  1. 复制github项目的ssh连接

  1. 克隆到本地
git clone 代码链接

三、github项目上传

修改完成之后,执行

# 添加全部文件
git add .

# 提交到本地仓库
git commit -m "提交备注"

# 推送到远程仓库
# git push 远程仓库链接名(默认origin) 本地分支名:远程分支名
git push origin main:main
标签: github

本文转载自: https://blog.csdn.net/weixin_43871207/article/details/128686450
版权归原作者 2018_XWJ 所有, 如有侵权,请联系我们删除。

“ssh公钥配置,使用git从github上拉取、上传项目”的评论:

还没有评论