[TOC]
## 1. git配置
### 1.1配置ssh
1.ssh-keygen -t rsa -C郵箱 一直按回車 直到出現圖案
2.雙擊我的電腦-桌面-系統文件夾-.ssh-id_rsa.pub 將內容復制出來
3.在遠端服務器 設置-ssh公鑰 中將粘貼相應內容
### 1.2 git的三個分區
1.git add . //添加到暫存區
2.git commit -m"xx" //添加到版本庫
3.git push //推送到遠程
### 1.3 git中的一些命令
1.git log打印日志信息,可以看到之前提交的版本;
2.git log --pretty=oneline只打印每一次提交的版本號
3 . (回到之前的版本)git reset --hard 版本號
4.要重返未來,用git reflog查看命令歷史,以便確定要回到未來的哪個版本
5.輸入 git pull將倉庫同步
6.撤銷修改 git checkout -- <fileName>
7.刪除文件rm rm <File>
7.1之后如果確定要刪除文件,命令行中輸入
git rm test.txt;
git commit -m "remove test.txt"
7.2另一種情況是刪錯了,因為版本庫里還有呢,所以可以很輕松地把誤刪的文件恢復到最新版本
git checkout -- test.txt
### 1.4將本地文件上傳到遠端服務器
1.使用 git bash here 命令
2.輸入 git add .
3.輸入 git commit -m"文件名稱"
4.輸入 git push 將文件推送上去
### 1.5從遠端服務器將項目下載到電腦
1. 在遠端點擊ssh 復制
2.在文件夾下使用 git bash here 命令
3.輸入 git clone 右鍵push
## 2.配置環境變量
### 2.1 Visual Studio Code 中配置環境變量(使用鍵盤快捷鍵)
1.在https://docs.ibase.work/ 中的工具中前端開發環境配置中復制相應的文字
2.在擴展中先安裝 open in browser 插件
3.在文件-首選項-鍵盤快捷方式-keybindings.json中將復制的文本粘貼到相應位置
4.使用ctrl+w在網頁中打開
~~~
// Place your key bindings in this file to overwrite the defaults
[
{ "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" },
{
"key":"ctrl+shift+/",
"command": "editor.action.blockComment",
"when": "editorTextFocus"
},
{
"key": "ctrl+w",
"command": "extension.openInDefaultBrowser"
},
{
"key": "ctrl+alt+f",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+f",
"command": "-editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
}
]
~~~