Windows安装Git
打开链接CNPM Binaries Mirror (npmmirror.com)
点击Git-2.43.0-64-bit.exe下载
在Git的安装过程中除了自定义安装位置,其余选项基本默认即可
VSCode设置Git
安装好Git后,重启VSCode即可使用源代码管理
在VSCode终端进行命令操作
git init git add . git commit -m "first commit" git branch -M main git remote add origin git@github.com:Ludweg/Test01.git git push -u origin main
图形界面操作
1、点击源代码管理,点击初始化仓库
2、点击暂存更改
3、输入“第一次提交”,点击提交
4、添加远程存储库,输入Github仓库的SSH:git@github.com:Ludweg/Test02.git , 输入仓库名
5、点击推送
VSCode配置SSH Key
Github配置ssh key的步骤(大白话+包含原理解释)_github生成ssh key_风中一匹狼v的博客-CSDN博客
可能遇到的报错
1、ssh: connect to host github.com port 22: Connection refused
2、SSL certificate problem: unable to get local issuer certificate
3、remote origin already exists
补充阅读
Github配置ssh key的步骤(大白话+包含原理解释)_github生成ssh key_风中一匹狼v的博客-CSDN博客
SSH:连接到主机github.com端口22:连接时间超时 - 天使阿丽塔 - 博客园 (cnblogs.com)
解决ssh: connect to host github.com port 22: Connection refused - Biile - 博客园 (cnblogs.com)
【 Git向远程仓库推送项目提示错误:remote origin already exists. (远程来源已经存在 解决办法)】_fpl1116的博客-CSDN博客