一些常用的基础命令总结-前端

88 阅读1分钟

nginx

//重启nginx
nginx -s reopen 

//重新加载Nginx配置文件,然后以优雅的方式重启Nginx
nginx -s reload 

//强制停止Nginx服务
nginx -s stop 

//优雅地停止Nginx服务(即处理完所有请求后再停止服务)
nginx -s quit 

yarn、npm

清除缓存

//npm
npm cache clean --force 
//yarn 
yarn cache clean

设置为淘宝镜像

//npm
npm config set registry https: //registry.npmmirror.com/
//yarn 
yarn config set registry https: //registry.npmmirror.com/ 

git取消上一次的git commit 提交

1.使用git reset命令,取消之前的提交

取消上一次提交

git reset HEAD~1

git reset HEAD^

撤回两次或者n次

git reset HEAD~2

回到的某个commit的状态

git reset --hard <commit_SHA-1> //<commit_SHA-1>表示要回到的commit的SHA-1

2.将修改推送到远程

git push --force origin <branch_name>