day01
1.git的简单应用
1.安装git软件并进行配置
简单的配置
打开git base
配置全局信息在命令行中输入
git config --global user.name +名称
git config --global user.email +邮箱
2.注册码云
3.项目
1.新建项目
在码云中登陆并选择新建项目选项
2.克隆
复制css中地址
在相应文件夹打开git
输入git cloen 后面黏贴复制的地址,回车

3.新建文档
在生成的文档中新建txt文档
4.进入文档右击空白地段选择git
输入git add .添加到暂存区
输入git commit -m'1',将1文件添加到版本库
输入git push上传到项目


4.撤回版本
用git log可查看之前的版本

回到之前的版本用git reset --hard 版本号
用git reflog查看命令历史,确定要回到未来的哪个版本

上述过程中三个区的概念如图所示

5.配置ssh
打开git base 输入ssh-keygen -t rsa -C +邮箱地址生成ssh
生成的文件如图所示在我的文档中的如下如图位置

用txt格式打开id_rsa.pub
复制文档中的全部信息
打开码云

添加ssh公钥
以后clone的项目使用SSH就不用输入用户密码了
2.Visual Studio Code的简单应用
1.
打开软件Visual Studio Code在扩展中搜索open in browser并安装
安装完成如图

2.
打开文件-首选项-键盘快捷方式
点开如图所示位置

将如下代码复制进去
[
{ "key": "alt+/", "command": "editor.action.triggerSuggest","when": "editorTextFocus" },
{ "key": "ctrl+d", "command": "editor.action.deleteLines","when": "editorTextFocus" },
{ "key": "ctrl+alt+down","command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" },
{ "key": "ctrl+alt+up", "command": "editor.action.copyLinesUpAction", "when": "editorTextFocus" },
{ "key": "shift+enter", "command": "editor.action.insertLineAfter", "when": "editorTextFocus && !editorReadonly" } ,
{"key":"ctrl+w","command": "extension.openInBrowser" , "when": "editorTextFocus" }
]
3.
新建html文件

ctrl+s保存
ctrl+w查看

网友评论