Skip to content

Commit a647e20

Browse files
committed
更新
1 parent fd4ae50 commit a647e20

8 files changed

+1681
-80
lines changed

Node模块/部署模块-pm2.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## pm2 使用方法
2+
- $ pm2 start app.js -i 4 # 后台运行pm2,启动4个app.js
3+
`也可以把'max' 参数传递给 start
4+
正确的进程数目依赖于Cpu的核心数目`
5+
6+
- $ pm2 start app.js --name my-api # 命名进程
7+
8+
9+
- $ pm2 list # 显示所有进程状态
10+
- $ pm2 monit # 监视所有进程
11+
- $ pm2 logs # 显示所有进程日志
12+
13+
- $ pm2 stop 0 # 停止指定的进程
14+
- $ pm2 stop all # 停止所有进程
15+
16+
- $ pm2 restart 0 # 重启指定的进程
17+
- $ pm2 restart all # 重启所有进程
18+
19+
- $ pm2 delete 0 # 杀死指定的进程
20+
- $ pm2 delete all # 杀死全部进程
21+
22+
- $ pm2 reload all # 0 秒停机重载进程 (用于 NETWORKED 进程)
23+
24+
- $ pm2 startup # 产生 init 脚本 保持进程活着
25+
- $ pm2 web # 运行健壮的 computer API endpoint (http://localhost:9615)

Nuxt/别名.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- [链接](www.baidu.com) -->
2+
<!-- ```
3+
代码块
4+
``` -->
5+
## 别名
6+
|别 名|目 录|
7+
|:-----:|:-----:|
8+
|~ 或 @ |src目录|
9+
|~~ 或 @@|根目录|
10+
11+
> 默认情况下,src目录和根目录相同
12+
13+
> vue 模板中, 如果你需要引入 assets 或者 static 目录, 使用 ~/assets/your_image.png 和 ~/static/your_image.png方式。

Nuxt/资源文件.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## 资源文件
2+
> 默认情况下,webpack会将 src url @import 解析成require
3+
4+
```
5+
例如
6+
url('~assets/image.png')
7+
-> require('~/assets/image.png')
8+
```

git小记.md

+126-80
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,177 @@
11

2-
修改设置
3-
$ git config --global user.name "Your Name"
4-
$ git config --global user.email "[email protected]"
2+
# 设置
53

6-
创建空目录
7-
$ mkdir learngit
8-
$ cd learngit
9-
$ pwd
4+
## 信息修改
105

11-
git init
12-
初始化一个Git仓库,将目录变成Git可以管理的仓库。其目录下会多了个.git的目录(默认为隐藏的,ls -ah命令可以显示)
6+
git config --global user.name "Your Name"
7+
git config --global user.email "[email protected]"
138

14-
git add <file>
9+
## 生成密匙
10+
11+
ssh-keygen -t rsa -C "[email protected]"
12+
一直回车,在用户主目录会生成.ssh目录,里面有id_rsa和id_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,id_rsa.pub是公钥。
13+
14+
# 关联
15+
16+
## 关联远程库
17+
18+
git remote add origin [email protected]:github-name/repo-name.git
19+
20+
## 克隆远程仓库到本地(自动关联)
21+
22+
git clone [email protected]:path/github-name.git
23+
24+
## 查看远程仓库的信息
25+
26+
git remote
27+
git remote -v (查看远程库更详细的信息,如果没有推送权限,就看不到push的地址)
28+
29+
## 关联本地仓库分支与远程仓库分支
30+
git checkout -b branch-name origin/branch-name
31+
在本地创建和远程分支对应的分支,本地和远程分支的名称最好一致
32+
33+
git branch --set-upstream branch-name origin/branch-name
34+
建立本地分支和远程分支的关联
35+
36+
# 文件操作
37+
38+
## 初始化仓库
39+
40+
git init
41+
42+
## 添加文件到暂存夹
43+
44+
git add <'file'>
1545
添加文件到仓库(类似于加入暂存夹)
46+
git add .
47+
添加全部文件到暂存夹
48+
49+
## 提交到本地仓库,并注释
1650

1751
git commit -m "注释"
1852
将文件提交到仓库,"注释"就是做标记,方便查找
1953

54+
## 删除文件
55+
git rm <'file'>
56+
57+
## 查看当前的状态
58+
2059
git status
2160
查看当前仓库的状态,哪些文件做了修改。
2261

23-
git diff <file>
24-
如果git status告诉你有文件被修改过,git diff查看修改内容。
62+
## 查看修改内容
63+
64+
git diff <'file'>
65+
如果git status告诉你有文件被修改过,git diff查看修改内容。
66+
67+
## 查看工作区和版本库里面最新版本的区别
2568

26-
git log
27-
查看提交历史。
69+
git diff HEAD -- <'file'>
70+
71+
## 查看提交记录
72+
73+
git log
74+
git log --pretty==oneline (精简输出的信息)
75+
76+
## 查看命令历史
2877

2978
git reflog
30-
查看命令历史
3179

32-
git log --pretty==oneline
33-
精简输出的信息
80+
# 版本回退
81+
82+
## 回退到上一个版本
3483

3584
git reset --hard HEAD^
36-
回退到上一个版本。
3785

38-
git reset --hard <commit_id>
39-
回退到指定id的版本
86+
## 回退到指定id的版本
4087

41-
git diff HEAD -- <file>
42-
查看工作区和版本库里面最新版本的区别
88+
git reset --hard <'commit_id'>
89+
90+
## 撤销工作区的修改
4391

44-
git checkout -- <file>
45-
把<file>文件在工作区的修改全部撤销。
46-
1.如果<file>工作区做了修改,直接运行git checkout -- <file>撤销
47-
2.如果<file>工作区做了修改并添加到了暂存区,先运行git reset HEAD <file>,再运行git checkout -- <file>撤销
92+
git checkout -- <'file'>
93+
把<'file'>文件在工作区的修改全部撤销。
94+
1.如果<'file'>工作区做了修改,直接运行git checkout -- <'file'>撤销
95+
2.如果<'file'>工作区做了修改并添加到了暂存区,先运行git reset HEAD <'file'>,再运行git checkout -- <'file'>撤销
4896

49-
git rm <file>
50-
删除一个文件
97+
## 修改commit注释
5198

52-
ssh-keygen -t rsa -C "[email protected]"
53-
一直回车,在用户主目录会生成.ssh目录,里面有id_rsa和id_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥,可以放心地告诉任何人。
99+
git commit --amend
100+
按i进入编辑模式
101+
esc退出编辑
102+
:wq保存并退出
54103

55-
git remote add origin [email protected]:github-name/repo-name.git
56-
关联远程库
104+
# 分支操作
57105

58-
git push -u origin master
59-
第一次推送master分支的所有内容。
60-
我们第一次推送master分支时,加上了-u参数,Git不但会把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来,在以后的推送或者拉取时就可以简化命令。
106+
## 查看分支
61107

62-
git push origin master
63-
推送最新修改
108+
git branch
64109

65-
git clone [email protected]:path/github-name.git
66-
克隆一个本地库
110+
## 创建分支
67111

68-
git branch
69-
查看分支
112+
git branch <'name>
113+
114+
## 切换分支
115+
116+
git checkout <'name>
70117

71-
git branch <name>
72-
创建分支
118+
## 创建+切换分支
73119

74-
git checkout <name>
75-
切换分支
120+
git checkout -b <'name>
121+
122+
## 合并某分支到当前分支
76123

77-
git checkout -b <name>
78-
创建+切换分支
124+
git merge <'name'>
79125

80-
git merge <name>
81-
合并某分支到当前分支
126+
git merge --no-ff -m "注释" <'name'>
127+
因为合并要创建一个新的commit,所以加上-m参数,把commit描述写进去
128+
--no-ff参数就可以用普通模式合并,合并后的历史有分支,能看出来曾经做过合并
129+
130+
## 删除分支
82131

83-
git branch -d <name>
84-
删除分支
132+
git branch -d <'name'>
85133

86-
git log --graph
87-
查看分支合并图
134+
## 强行删除分支
88135

89-
git log --graph --pretty=oneline --abbrev-commit
90-
查看分支合并图(精简)
136+
git branch -D <'name'>
137+
138+
## 查看分支合并图
91139

92-
git merge --no-ff -m "注释" <name>
93-
因为合并要创建一个新的commit,所以加上-m参数,把commit描述写进去
94-
--no-ff参数就可以用普通模式合并,合并后的历史有分支,能看出来曾经做过合并
140+
git log --graph
141+
git log --graph --pretty=oneline --abbrev-commit (精简)
142+
143+
## 将当前分支储存起来
95144

96145
git stash
97-
将当前分支的工作现场“储藏”起来。
98146

99-
git stash pop
100-
恢复当前分支的工作现场,并把stash的内容删除
147+
## 恢复当前分支的工作现场
101148

102-
git stash apply
103-
git stash drop
104-
恢复当前分支的工作现场
105-
把stash的内容删除
149+
git stash pop (此命令会删除stash的内容)
150+
git stash apply (此命令不会删除stash的内容)
151+
git stash drop
152+
153+
## 查看stash的内容
106154

107155
git stash list
108-
查看stash的内容
109156

110-
git branch -D <name>
111-
强行删除分支。用于丢弃一个没有被合并过的分支。
157+
# 推送and拉取
112158

113-
git remote
114-
查看远程库的信息
159+
## 推送到远程分支
115160

116-
git remote -v
117-
查看远程库更详细的信息,如果没有推送权限,就看不到push的地址。
161+
git push -u origin master
162+
第一次推送master分支的所有内容。
163+
我们第一次推送master分支时,加上了-u参数,Git不但会把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来,在以后的推送或者拉取时就可以简化命令。
118164

119-
git push origin <branch-name >
120-
推送分支,如果推送失败,先用git pull抓取远程的新提交
165+
## 推送最新修改
121166

122-
git pull
123-
抓取远程的新提交
167+
git push origin master
124168

125-
git checkout -b branch-name origin/branch-name
126-
在本地创建和远程分支对应的分支,本地和远程分支的名称最好一致
169+
## 推送本地分支到远程仓库
127170

128-
git branch --set-upstream branch-name origin/branch-name
129-
建立本地分支和远程分支的关联
171+
git push origin <'branch-name'>
172+
推送分支,先用 git pull抓取远程的新提交
130173

174+
## 拉取远程仓库到本地
131175

176+
git pull (抓取远程的新提交)
177+
git pull origin <'branch-name'>

oss上传图片操作.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## oss上传图片
2+
3+
### 步骤
4+
5+
1. [oss-browser 下载](https://github.com/aliyun/oss-browser/blob/master/all-releases.md)
6+
7+
2. 登录进入,选择Bucket -> 项目文件夹 -> 点击文件上传 -> 获取oss上面的图片地址
8+
9+
### 示例
10+
11+
![](https://ws1.sinaimg.cn/large/a427f935gy1fxus2q4y4pj21640o9q4w.jpg)
12+
13+
![](https://ws1.sinaimg.cn/large/a427f935gy1fxus61duvqj216e0o8ac5.jpg)
14+
15+
![](https://ws1.sinaimg.cn/large/a427f935gy1fxus6li2x3j21650o8wfy.jpg)
16+
17+
![](https://ws1.sinaimg.cn/large/a427f935gy1fxus7wzos6j21670o3wgo.jpg)
18+
19+
![](https://ws1.sinaimg.cn/large/a427f935gy1fxus8ozkl6j216d0oh0vm.jpg)
20+

0 commit comments

Comments
 (0)