今天学到什么?
1.git的配置
1.1ssh
的配置
ssh-keygen -t rsa -C xxxxxx@qq.com
![](https://img.haomeiwen.com/i13085871/cd99b17caa9b89b2.png)
![](https://img.haomeiwen.com/i13085871/0e5c941668ba4880.png)
![](https://img.haomeiwen.com/i13085871/2fd602821d91d0b9.png)
将id-rsa.pub的内容复制到公钥里面
1.2git
的三个区
![](https://img.haomeiwen.com/i13085871/1597154973053e5b.png)
git add //添加到暂存区
git commit //添加到版本库
git push //推送到远程
2.vscode的环境配置
-
2.1插件安装
Open in browser
-
2.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" }
]
将以下内容按后面的步骤粘贴进
keybindings.json
5.png
进入以下界面
6.png
代码复制于下列框中
7.png
至此快捷键设置完成,按ctrl+w
预览
3.版本回退
-
3.1 git log打印日志信息,可以看到之前提交的版本;
![](https://img.haomeiwen.com/i13085871/d0710c873ab46897.png)
-
3.2时光穿梭机(回到之前的版本)git reset --hard 版本号
![](https://img.haomeiwen.com/i13085871/f6c169b98e6756c8.png)
-
3.3要重返未来,用git reflog查看命令历史,以便确定要回到未来的哪个版本
![](https://img.haomeiwen.com/i13085871/d5a0380b025789dc.png)
网友评论