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 后面黏贴复制的地址,回车
![](https://img.haomeiwen.com/i13085879/748d2ed1a051a8f0.png)
3.新建文档
在生成的文档中新建txt文档
4.进入文档右击空白地段选择git
输入git add .添加到暂存区
输入git commit -m'1',将1文件添加到版本库
输入git push上传到项目
![](https://img.haomeiwen.com/i13085879/067e42a114da52ee.png)
![](https://img.haomeiwen.com/i13085879/efbfea94cb6c3516.png)
4.撤回版本
用git log可查看之前的版本
![](https://img.haomeiwen.com/i13085879/8afd690893ffeabf.png)
回到之前的版本用git reset --hard 版本号
用git reflog查看命令历史,确定要回到未来的哪个版本
![](https://img.haomeiwen.com/i13085879/b2500d9a8e6375af.png)
上述过程中三个区的概念如图所示
![](https://img.haomeiwen.com/i13085879/e2cceb72c305b3fe.png)
5.配置ssh
打开git base 输入ssh-keygen -t rsa -C +邮箱地址生成ssh
生成的文件如图所示在我的文档中的如下如图位置
![](https://img.haomeiwen.com/i13085879/ca85d0007fc25572.png)
用txt格式打开id_rsa.pub
复制文档中的全部信息
打开码云
![](https://img.haomeiwen.com/i13085879/dc5f55028cb22a79.png)
添加ssh公钥
以后clone的项目使用SSH就不用输入用户密码了
2.Visual Studio Code的简单应用
1.
打开软件Visual Studio Code在扩展中搜索open in browser并安装
安装完成如图
![](https://img.haomeiwen.com/i13085879/d0e9df79ecbd9490.png)
2.
打开文件-首选项-键盘快捷方式
点开如图所示位置
![](https://img.haomeiwen.com/i13085879/5350ed6590139adc.png)
将如下代码复制进去
[
{ "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文件
![](https://img.haomeiwen.com/i13085879/cab831ce79a11a73.png)
ctrl+s保存
ctrl+w查看
![](https://img.haomeiwen.com/i13085879/0b410800b1dfb607.png)
网友评论