常用

GIT

设置http、https代理

git config --global http.proxy socks5://127.0.0.1:1080

git config --global https.proxy socks5://127.0.0.1:1080

查看http、https代理配置情况

git config --global --get http.proxy

git config --global --get https.proxy

取消http、https代理配置

git config --global --unset http.proxy

git config --global --unset https.proxy

git删除远程分支

git push origin --delete [branch_name]

生成ssh密钥

ssh-keygen -t rsa -C "xxxx@xxxxx.com(此处填写你的邮箱)"

查看ssh密钥

cat ~/.ssh/id_rsa.pub

删除本地分支

git branch -d <branch-name>

删除远程分支

git push origin --delete [branch_name]

回滚代码到某个commit

回退到上个版本

git reset --hard HEAD^

回退到前3次提交之前,以此类推,回退到n次提交之前

git reset --hard HEAD~3

退到/进到 指定commit的sha码

git reset --hard commit_id

强推到远程

注意:查询是否有分支强制推送的权限

git push -f -u origin master(需要回退的分支)

NPM

设置http代理

npm config set proxy=http://127.0.0.1:1080

取消代理

npm config delete proxy

npm设置淘宝镜像

npm config set registry=https://registry.npm.taobao.org

npm取消淘宝镜像

npm config delete registry

查看代理信息(当前配置)

npm config list

sass

安装

npm install --save-dev node-sass

npm install --save-dev sass-loader

sass-loader版本过高运行错误TypeError: this.getOptions is not a function

npm install -S sass-loader@10.x

卸载

npm uninstall --save-dev node-sass

npm uninstall --save-dev sass-loader

superbad.cn