一.vue项目创建

二.创建本地仓库并和远程仓库进行绑定
在vue3-project-git 项目文件夹下 初始化一个新的Git仓库,可以看到初始化成功之后就会出现一个.git文件,该文件包含所有必要的 Git 配置和版本控制信息。
创建远程仓库: 打开gitee ,点击右上角 '+'创建仓库

设置ssh密钥:打开gitee,点击右上角头像打开设置,找到ssh公钥

返回git bash命令行工具 ,输入ssh-keygen -t rsa生成公钥,用cat ~/.ssh/id_rsa.pub查看公钥

将ssh公钥选中右键复制,粘贴到gitee生成公钥处,点击确定


将本地仓库推送到远程仓库
git remote add origi 地址

地址从gitee的该远程仓库获取

通过git remote 查看是否绑定了远程仓库,可以看到已经绑定了

执行以下指令将文件提交
git add .
git commit -m 'initial commit'

将本地仓库内容推送到远程仓库
三.用vscode打开vue3-project-git项目,在其中使用git

安装插件git graph

左边出现的新图标 就是安装的扩展

修改了app.vue的内容,然后点击分支的"+"暂存

然后 点击提交,提交上边写上注释

查看日志,可看到提交信息


打开远程仓库,打开app.vue文件,可以发现已经发生了改变,推送成功
