Windows git配置及关联github

下载并安装git

注册github(如果已经注册,跳过)

https://github.com/
记住注册的用户名和邮箱

配置git

  • 配置用户名和邮箱

进入powerShell终端:执行下面的命令配置用户名和邮箱
git config --global user.name "你的github上的名字"
git config --global user.email "你的github邮箱"
使用 git config --list 查看配置结果

  • 本地生成ssh 的key

ssh-keygen -t rsa -C "你的github邮箱"

执行 "cat C:\Users\某.ssh\id_rsa.pub" 或者直接通过资源管理器打开这个文件;复制刚刚生成的key。

打开github网站,在settings->SSH and GPLKeys
贴上刚刚的key

  • 验证github的连通性
    ssh git@github.com
posted @ 2022-11-04 19:43  吾日三省吾身-学习  阅读(136)  评论(0)    收藏  举报