VS code git配置 学习笔记

VS code git配置

  • VS code与git安装
    直接在腾讯管家的软件管理就能找到VS code,点击安装即可,启动VS code 会自动提示安装git,如果没有提示可以在这里下载安装然后配置环境变量即可。
  • 配置git
    全局配置
git config --global user.name "your name" 
git config --global user.email "your email"

推送到GitHub平台

cd  D:\GitHub          //选择工作目录,即项目所在目录
//没有项目时
git init
touch README.md
git add README.md
git commit -m "hello"
git remote add origin https://https://github.com/youname/test.git   
//youname为你的用户名,test.git为在GitHub创建好了的仓库
git push -u origin master  //提交到仓库
//已有git项目时
cd git项目目录
git remote add origin https://https://github.com/yourname/test.git   
git push -u origin master

从GitHub clone项目

cd //选择存放目录r
git clone https://github.com/yourname/test.git     //test.git  为GitHub上的仓库

整个过程代码在GitHub上创建新的仓库时有详细提示

  • VS code管理git
    使用vs code打开仓库文件夹
    这里没有改动任何文件,所以这里没有可暂存的文件

    先提交暂存,然后推送即可同步到GitHub云端了

猜你喜欢

转载自blog.csdn.net/qq_36881091/article/details/84326111