12 次浏览
1、安装并配置GIT
1)点击左侧【源代码管理】,按提示安装 Git
2)首次安装 Git 后,点击桌面图标【Git Bash】,弹出 Git 命令行终端,输入指令git config –list,会在命令行出现当前的 Git 配置内容
git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=schannel
core.autocrlf=true
core.fscache=true
core.symlinks=false
core.editor="C:\\Program Files\\Microsoft VS Code\\bin\\code" --wait
pull.rebase=false
credential.helper=manager
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
gui.recentrepo=D:/STM32/STM32_VSCode_Demo
3)配置全局用户名:输入指令git config –global user.name 你的用户名
git config --global user.name peng4)配置全局邮箱:输入指令:git config –global user.email pengxuqi@icloud.com
git config --global user.email pengxuqi@icloud.com2、从 VS Code 发布代码到 GitHub
在VS Code中打开项目文件后,依次点击【源代码管理】-【存储库】-【远程】-【添加远程存储库】,将Github上新建的仓库关联到本地的项目文件
或者直接点击【源代码管理】-【存储库】-【发布到GitHub】